Java 硒网格&x2B;TestNG+;Maven+;pom.xml

Java 硒网格&x2B;TestNG+;Maven+;pom.xml,java,maven,selenium,jenkins,Java,Maven,Selenium,Jenkins,您好,我有很多selenium测试要在Jenkins上运行,使用pom.xml设置-我的问题是,一旦第一个测试失败-将不再运行任何测试 失败的测试: TSLandingPageTest.testInit:73 » NoSuchElement no such element: Unable to locat... TSLoginEmployeeTest.testTSLoginBGImage:108 » NoSuchElement no such element: Un... TSLogin

您好,我有很多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
tLandingPageTest.testInit:73»无接触元素无此类元素:无法定位。。。
TestTSLoginEmployeeTest.TestTSLoginGimage:108»无接触元素无此类元素:Un。。。
TSLoginEmployeeTest.testTSLoginPortlet:121»NoTouchElement没有这样的元素:Un。。。
TSLoginEmployeeTest.testTSLoginTopBanner:93登录页面标题应为:但为:
测试运行:174,失败:4,错误:0,跳过:167

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

你的意思是在方法之前还是第一次测试之前

如果由于@Before方法失败而跳过测试,但您希望继续测试,则可以使用以下参数运行测试

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

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

  • 嗨,不,这是@before或我正在运行的第一个测试上面有174个测试-在上面的测试运行中,跳过了167个测试,所以实际上只运行了7个测试。这是因为测试7失败,然后跳过所有剩余的测试。我希望所有测试都运行或尝试运行,并且跳过了等于零的测试。
    -configfailurepolicy continue