超时异常:等待net.serenitybdd.core.pages.WebElementFacade for selenium webdriver 40秒后超时

时间:2018-05-02 05:37:26

标签: java selenium selenium-webdriver serenity-bdd cucumber-serenity

我正在运行硒测试,并突然失误。测试运行并不是每次都一致。有时会失败,有时它会通过。它失败的步骤也没有固定,每次都在不同的步骤失败。

错误讯息: 超时异常:等待net.serenitybdd.core.pages.WebElementFacade for selenium webdriver 40秒后超时

以下是我使用的版本: Chrome - v65 Chrome驱动程序 - v2.38 硒 - v2.53 宁静 - v1.1.36

我没有编写代码,因为它没有修复它将失败的步骤。 有人可以帮忙吗?

添加错误跟踪:

<?xml version="1.0" encoding="UTF-8"?><testsuite errors="1" failures="0" name="To create project and allocate resources" skipped="0" tests="12" time="1280.85" timestamp="2018-04-117 10:22:25"><testcase name="UC_PM_01_Create Project from Template"/><testcase name="UC_PM_05_Populate PMO Data"/><testcase name="UC_PM_15_Resource Allocation"><error message="Timed out after 40 seconds waiting for net.serenitybdd.core.pages.WebElementFacadeImpl$1@5be052ca&#10;Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'&#10;System info: host: '*', ip: '*', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0-ea'&#10;Driver info: driver.version: unknown&#10;Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'&#10;System info: host: '*', ip: '*', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0-ea'&#10;Driver info: driver.version: unknown" type="org.openqa.selenium.TimeoutException">Timed out after 40 seconds waiting for net.serenitybdd.core.pages.WebElementFacadeImpl$1@5be052ca
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: '*', ip: '*', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0-ea'
Driver info: driver.version: unknown
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: '*', ip: '*', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0-ea'
Driver info: driver.version: unknown</error><system-err>Timed out after 40 seconds waiting for net.serenitybdd.core.pages.WebElementFacadeImpl$1@5be052ca
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: '*', ip: '*', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0-ea'
Driver info: driver.version: unknown
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: '*', ip: '*', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0-ea'
Driver info: driver.version: unknown&#13;
com.org.macquarie.clarity.actions.WebActions.verifyElementIsDisplayed(WebActions.java:296)&#13;
com.org.macquarie.clarity.steps.HomeSteps.clickHomeMenuLinks(HomeSteps.java:30)&#13;
</system-err></testcase><testcase name="Uc pm 18  adding resource to team will update~rmw task"/></testsuite>

1 个答案:

答案 0 :(得分:0)

此错误消息......

<error message="Timed out after 40 seconds waiting for net.serenitybdd.core.pages.WebElementFacadeImpl$1@5be052ca&#10;Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'&#10;System info: host: '*', ip: '*', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0-ea'&#10;Driver info: driver.version: unknown&#10;Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'&#10;System info: host: '*', ip: '*', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0-ea'&#10;Driver info: driver.version: unknown" type="org.openqa.selenium.TimeoutException">Timed out after 40 seconds waiting for net.serenitybdd.core.pages.WebElementFacadeImpl$1@5be052ca
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: '*', ip: '*', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0-ea'

...暗示服务员提出 TimeoutException 并且无法找到elelemt。

但是,您使用的二进制文件之间的主要问题是版本兼容性,如下所示:

  • 您的 Selenium客户端版本 2.53.0 2016-03-15 10:43:46 ,这比更多2年年长。
  • 您的 JDK版 1.8.0-ea ,非常古老

因此, JDK v8u0-ea Selenium Client v2.53.0 Chrome v65.x 之间明显不匹配> ChromeDriver v2.38

解决方案

  • JDK 升级到最近的级别JDK 8u162
  • Selenium 升级到当前级别Version 3.11.0
  • 通过 IDE 清理您的项目工作区仅使用所需的依赖项重建项目
  • 使用CCleaner工具清除执行测试套件之前和之后的所有操作系统杂务。
  • 如果您的基本 Web客户端版本太旧,请通过Revo Uninstaller将其卸载并安装最新的GA和已发布的 Web客户端版本。
  • 进行系统重启
  • 执行@Test