TestNG: running multiple sets with the saved order using the <suite-files> tag

I am trying to run multiple sets from one package file. I define the classes that I need to run and run the "master" file. I used save-order to run each set sequentially, however the behavior is not as I expected. It seems that he runs immediately, one after another, almost in parallel.

Does anyone know a way that I can execute packages while keeping order, ideally waiting for the completion of the first set before the second package is launched?

My set of settings is as follows:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="My test suite" preserver-order=true> <suite-files> <suite-file path="Test1.xml"></suite-file> <suite-file path="Test2.xml"></suite-file> <suite-file path="Test3.xml"></suite-file> </suite-files> </suite> 

Regards, Jaco

+5
source share
4 answers

Is there a problem that you did not specify the attribute correctly? It should be

keep order = true

not

condom order = truth

0
source

The best option is to remove the tag of the package file (since it does not depend on the save-order design option) and refactor testng.xml to use test tags and group dependencies or reservation order.

0
source

According to the testng documentation ,

By default, TestNG will run your tests in the order in which they are in the XML file. If you want the classes and methods listed in this file to execute in an unpredictable order, set the save-order attribute to false

In addition, if you want execution to be performed in an unpredictable way, you can do it as follows.

 <suite name="My test suite" preserver-order="false"> <suite-files> <suite-file path="Test1.xml"></suite-file> <suite-file path="Test2.xml"></suite-file> <suite-file path="Test3.xml"></suite-file> </suite-files> </suite> 

You must specify

preserve-order = "false"

not

preserve-order = false

0
source

In the Suite tag, specify the thread-count = 1, parallel = "false" attribute. Let me know if this works.

-1
source

Source: https://habr.com/ru/post/1203292/


All Articles