以特定顺序使用 testng 重复测试用例 TestA ->测试B->测试C->测试A ->测试D [英] repeating test cases using testng in specific order TestA -> TestB -> TestC -> TestA -> TestD

查看:29
本文介绍了以特定顺序使用 testng 重复测试用例 TestA ->测试B->测试C->测试A ->测试D的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够以这种特定顺序执行测试用例,其中每个测试用例都依赖于前一个.请注意,TestA 和 TestC 将按此顺序再次执行.我如何使用 testng 和 Java 来做到这一点.

I want to be able to execute test cases in this specific order where in each one is dependent on the previous one. Note that TestA and TestC is going to be executed again in this sequence. How can I do that using testng and Java.

TestA -> TestB -> TestC -> TestA -> TestX -> TestC

TestA -> TestB -> TestC -> TestA -> TestX -> TestC

推荐答案

在一次运行中不可能多次运行相同的测试.

It is not possible to run the same test many times during one run.

相反,您可以:

TestA -> TestB -> TestC -> TestD -> TestX -> TestY

其中 TestDTestY 只是调用 TestATestC 方法.

where TestD and TestY are just calling TestA and TestC methods.

然后,你只需要配置方法之间的依赖:http://testng.org/doc/documentation-main.html#dependent-methods

Then, you just have to configure dependency between methods: http://testng.org/doc/documentation-main.html#dependent-methods

这篇关于以特定顺序使用 testng 重复测试用例 TestA ->测试B->测试C->测试A ->测试D的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆