susantjs
susantjs

Reputation: 939

How to reorder test execution based on dataprovider?

Using TestNG @DataProvider will trigger tests in the following order:

Assuming dataprovider returns { [0], [1], [2] }, TestNG runs:

test1(0)
test1(1)
test1(2)

test2(0)
test2(1)
test2(2)
...

Is there any way to trigger the tests to run in this order?

test1(0)
test2(0)

test1(1)
test2(1)

test1(2)
test2(2)
...

A thousand thanks for your help!

Upvotes: 1

Views: 270

Answers (1)

Cedric Beust
Cedric Beust

Reputation: 15608

Use

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

Upvotes: 1

Related Questions