2017-07-18 81 views
1

您好我有一些硒测试运行在詹金斯,使用pom.xml安装程序 - 我的问题是第一次测试失败 - 没有更多的测试将运行。硒网格+ TestNG + Maven + 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 

我如何获得所有的测试运行,即使有些会失败?谢谢

回答

1

你是指@before方法还是先测试?

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

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

-configfailurepolicy continue 

,如果你的第一次测试失败和其他被跳过,这可能是由于扶养 有两种方法可以做到这一点。

  1. 删除依赖
  2. 测试你想,即使相关的测试运行失败,它们标记为alwaysRun=True
+0

HI不,它是@Before还是第一次测试 – user6231315

+0

上面,我跑174个测试 - 在上述测试运行中,跳过了167次测试,所以只有7次测试运行。这是由于测试7失败,然后所有剩余的测试都会跳过。我想要所有测试运行或试图运行,并跳过了等于零。 – user6231315