gpt4 book ai didi

java - Selenium Grid+TestNG+Maven+pom.xml

转载 作者:行者123 更新时间:2023-11-30 06:36:14 25 4
gpt4 key购买 nike

嗨,我有许多 Selenium 测试要在 Jenkins 上运行,使用 pom.xml 设置 - 我的问题是一旦第一个测试失败 - 将不再运行测试。

失败的测试:

TSLandingPageTest.testInit:73 » NoSuchElement no such element: Unable to locat...
TSLoginEmployeeTest.testTSLoginBGImage:108 » NoSuchElement no such element: Un...
TSLoginEmployeeTest.testTSLoginPortlet:121 » NoSuchElement no such element: Un...
TSLoginEmployeeTest.testTSLoginTopBanner:93 Login Page Title expected:<Login | IBM Talent Management Solutions> but was:<Invalid URL | IBM Talent Management Solutions>

Tests run: 174, Failures: 4, Errors: 0, Skipped: 167

即使有些测试失败了,我如何才能运行所有测试?谢谢

最佳答案

你的意思是@before方法还是第一个测试?

如果您的测试因 @Before 方法失败而被跳过,但您想继续测试,您可以使用以下参数运行。

http://testng.org/doc/documentation-main.html#running-testng

-configfailurepolicy continue

如果您的第一个测试失败并且其他测试被跳过,则可能是由于依赖关系有两种方法可以做到这一点。

  1. 删除依赖项
  2. 即使依赖测试失败也要运行测试,将它们标记为 alwaysRun=True

关于java - Selenium Grid+TestNG+Maven+pom.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45168945/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com