0
votes

I would like all my classes running sequentially. Below is my testng xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite"  parallel="instances" thread-count="1">
  <test name="Test">
    <classes>
      <class name="atk.tests.Printer"/>
      <class name="atk.tests.Rejecteur"/>
      <class name="atk.tests.Specfeatures"/>
    </classes>
  </test> <!-- Test -->
</suite> <!-- Suite -->

I've tried in suite name tag to do :

<suite name="Suite" parallel="instances" thread-count="1"> then

<suite name="Suite" parallel="false" >

And then in classes:

<classes parallel="methods">

No solution is working to make my tests running sequentially. For the moment, they are running in parallel and i would like to avoid that.

Is anyone able to provide a solution for that ? Thanks

2
Check also in the pom.xml file: check the <threads> , <parallel> and <threadCount>. Number of threads should be 1 to avoid parallelism.Serban BR

2 Answers

0
votes
  • By default, TestNG will run your tests in the order they are found in the XML file. If you want the classes and methods listed in this file to be run in an unpredictable order, set the preserve-order attribute to false

For this ordering, you can use the XML attribute group-by-instances. This attribute is valid either on <suite> or <test>

<suite name="Suite" group-by-instances="true">

or

<test name="Test" group-by-instances="true">
0
votes

try once with preserver order true and parallel none

 <suite name="Suite" parallel="none" preserve-order="true">