Bhargav
Bhargav

Reputation: 25

Using testNG @Factory: Instances are run in parallel.

I have a factory returning array of Mytestclass with different params. Mytestclass has ten tests which are ordered using dependsOnmethods.

When I run the tests using factory, my first test is run for the first instance. Then the same test is executed for the second instance. After the first test is run on all the instances, it resumes second test on the first instance. I need it to run all tests on the first instance and then move to second and so on. Please suggest.

Upvotes: 1

Views: 1342

Answers (2)

Krishnan Mahadevan
Krishnan Mahadevan

Reputation: 14746

Have you tried using the suite xml attribute group-by-instances=true and see if that helps?

Upvotes: 1

jmccure
jmccure

Reputation: 1249

Are you running the tests in parallel mode? Try without it.

Upvotes: 0

Related Questions