Priority in TestNG with multiple classes

In your suite xml use group-by-instances=”true”

Sample, where TestClass1 and TestClass2 has the same content as yours

<suite thread-count="2" verbose="10" name="testSuite" parallel="tests">
<test verbose="2" name="MytestCase" group-by-instances="true">
    <classes>
        <class name="com.crazytests.dataproviderissue.TestClass1" />
        <class name="com.crazytests.dataproviderissue.TestClass2" />
    </classes>
</test>
</suite> 

I get the output

testA1

testA2

testA3

testB1

testB2

testB3

Leave a Comment