【发布时间】:2016-03-29 07:03:16
【问题描述】:
我正在尝试在 IE11 中执行 selenium webdriver java 代码,即使在页面完全加载后它也会抛出“NoSuchElementException”。
- Web 驱动程序:IEDriverServer_Win32_2.53.0
- IE 版本:11
- 硒:selenium-server-standalone-2.53.0.jar
- java : jdk1.8
应用程序由 LoginPage 和主页组成。在首页,点击“添加客户”按钮即可添加客户详细信息。
登录到应用程序在 IE11 中成功执行。登录后,“添加客户”按钮抛出 NoSuchElementException。
以下是selenium Java 代码:
driver.findElement(By.id("btnAddCustToQueue")).click();
以下是jsp代码:
<DIV class="blueButton floatLeft pie_first-child" id=btnAddCustToQueue onclick=openAddCustomer() _pieId="_158">Add<BR>Customer </DIV>
下面是抛出的异常:
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with id == btnAddCustToQueue (WARNING: The server did not provide any stacktrace information)
我已使用显式等待“添加客户”按钮加载。在这种情况下,“TimeOutException”如下所示:
Exception in thread "main" org.openqa.selenium.TimeoutException: Timed out after 30 seconds waiting for element to be clickable: By.id: btnAddCustToQueue
相同的代码在 CHROME 浏览器上运行良好。 我不确定最新的IE是否有问题。
提前致谢。
【问题讨论】:
-
我也面临同样的问题。你有解决办法吗?
-
你能在公共 URL 上复制这个吗?
标签: java selenium selenium-webdriver internet-explorer-11