tags:

views:

14

answers:

1

I have tests from 2 classes need to run, and trigger from testng.xml use config like

<classes>
        <class name="com.xyz.TestA"></class>
    <class name="com.xyz.TestB"></class>
</classes>
  • In TestA, have methods: i1, i2, i3, i4
  • In TestB, have methods: j1, j2, j3, j4

then test run as following sequence.

i1, i3, j1, j4, i2, i4, j2, j3

Anybody know the reason? Pls kindly help~ Many thanks!

A: 

If you are using the latest TestNG, use "preserve-order":

<test name="foo" preserve-order="true">
  <classes>
    <class...>
Cedric Beust