0

我正在运行硒测试并突然低于错误。测试运行并非每次都始终如一地通过。有时会失败,有时会通过。而且失败的步骤也不是固定的,每次都在不同的步骤失败。

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

以下是我正在使用的版本: Chrome - v65 Chrome 驱动程序 - v2.38 Selenium - v2.53 Serenity - 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>
4

1 回答 1

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 客户端版本是2016-03-15 10:43:462.53.0,比它早2 年
  • 您的JDK 版本1.8.0-ea,非常古老

因此JDK v8u0-eaSelenium Client v2.53.0Chrome v65.xChromeDriver v2.38之间存在明显的不匹配

解决方案

  • 将JDK升级到最新级别JDK 8u162
  • 将Selenium升级到当前级别Version 3.11.0
  • 通过IDE清理项目工作区并仅使用所需的依赖项重建项目。
  • 使用CCleaner工具在执行测试套件之前和之后清除所有操作系统杂务。
  • 如果您的基本Web Client版本太旧,请通过Revo Uninstaller卸载它并安装最新的 GA 和已发布版本的Web Client
  • 重新启动系统
  • 执行你的@Test.
于 2018-05-02T06:54:04.033 回答