在最大尝试之后,Testng RetryListener未能通过测试案例

时间:2018-07-23 15:50:29

标签: java maven selenium junit testng

我通过以下链接http://www.seleniumeasy.com/testng-tutorials/execute-only-failed-test-cases-using-iretryanalyzer使用了TestNG RetyListener,然后将侦听器包含在testng.xml中。

  1. 将测试用例作为TestNG套件运行时,它运行良好,并且在最大重试后测试被标记为FAILURE(失败)。
Selected environment: QA
Retrying test testcase1 with status FAILURE for the 1 time(s).
testcase1 skipped.
Retrying test testcase1 with status FAILURE for the 2 time(s).
testcase1 skipped.
Retrying test testcase1 with status FAILURE for the 3 time(s).
testcase1 skipped.
ERROR: testcase1 has failed
  1. 使用maven命令运行该命令时(mvn clean test),在最大重试次数后将测试标记为已跳过,这会导致生成“魅力”报告。
Retrying test testcase1 with status FAILURE for the 1 time(s).
testcase1 skipped.
Retrying test testcase1 with status FAILURE for the 2 time(s).
testcase1 skipped.
Retrying test testcase1 with status SKIP for the 3 time(s).

在使用Maven时需要获得与TestNG相同的行为的帮助

1 个答案:

答案 0 :(得分:1)

将您的TestNG依赖项更新到最新版本:

  <!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.14.3</version>
    <scope>test</scope>
</dependency>