以下是与我的流程相关的详细信息 -
- 页面 - 1 - 登录网页
- 登录后,会出现一个 URL(我们称之为元素 1)
- 单击元素 1 后,网页再次加载,我需要单击另一个元素(我们称之为元素 2)。
问题 -
驱动程序被卡住,元素 1 没有被点击或添加足够的等待元素 1 被点击但现在驱动程序卡在这个流程中,正如您可以从下面的代码中观察到的那样,一旦clickurl.click()
被调用然后 10 秒后我应该收到一条消息那“睡眠完成..现在我们回到调用类”
但相反,我得到了例外。
代码 -
clickurl = d1.findElement(By.xpath("XPath for Element 1"));
if ( clickurl != null ) {
System.out.print("****** Clicking on it Directly ");
clickurl.click();
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.print("****** Sleep Completed.. Now we return to calling class ");`
系统详情 -
- InternetExplorerDriver 服务器(64 位)3.14.0.0
- 操作系统名称:“Windows 10”
- Java 版本:“1.8.0_191”
其他详情 -
- 请注意,单击元素 1 后,我使用
driver.switchTo().defaultContent();
错误详情 -
Dec 11, 2018 5:02:56 PM org.openqa.selenium.remote.ErrorCodes toStatus
INFO: HTTP Status: '500' -> incorrect JSON status mapping for 'timeout' (408 expected)
Exception in thread "main" org.openqa.selenium.TimeoutException: Timed out waiting for page to load.