0
votes

I have ordered the automated test in a particular sequence by using the priority=xxx in @Test annotation.

For the last class to be tested, the priority values started with 10201 and above. However, this particular class was tested right after the 1st class with priorities from 1-10.

Does any one have any idea? I looked at the TestNG documentaion - but the values are not discussed.

1
Keep in mind, tests with the lower priority value will be executed first.sen4ik

1 Answers

1
votes

I looked into TestNG source code and looks like priority is an int, so the max value will be 2147483647.

In fact, you can test it easily by running following tests:

import org.testng.annotations.Test;
public class Testing {

    @Test(priority = 2147483647)
    public void testOne() {
        System.out.println("Test One");
    }

    @Test(priority = 1)
    public void testTwo() {
        System.out.println("Test Two");
    }
}