简体   繁体   English

TestNG:顺序运行测试

[英]TestNG : run tests sequentially

I have a problem to configure in a correct way my testng.xml. 我在以正确的方式配置我的testng.xml时遇到问题。

I want to run all my test sequentially. 我想按顺序运行所有测试。 One by one. 逐一。

in my xml file I have this code : 在我的xml文件中,我有以下代码:

<test name="Init" preserve-order="true" parallel="false">
    <classes>
        <class name="tests.Init" />
        <class name="tests.test1" />
        <class name="tests.test2" />
    </classes>
</test>

but when I run testng, all the three tests run at the same time. 但是当我运行testng时,所有三个测试都同时运行。

How can I set testng to launch one test after another ? 我该如何设置testng依次启动一个测试?

What TestNG version are you using? 您正在使用什么TestNG版本? I'm not sure that you can declare parallel = "false" , it must be one of these levels: methods, classes, tests, instances. 我不确定是否可以声明parallel =“ false” ,它必须是以下级别之一:方法,类,测试,实例。 see this 看到这个

Try to change: 尝试更改:

<test name="Init" preserve-order="true" parallel="false">

To: 至:

<suite name="TestSuite" thread-count="1" parallel="classes" preserve-order="true">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM