0
@Test(priority=2)

public class PositiveTests {
 
    public void loginTest() {
}
@Test(priority=1)

public class NegativeTests {

    public void negativeLoginTest() {
}

TestNg.xml

<classes>
            <class name="com.herokuapp.theinternet.PositiveTests" />
            <class name="com.herokuapp.theinternet.NegativeTests">
</classes>

-->> Will the priority work here? Which class will run first? Positive Test or Negative Test?

1 Answers1

0

priority works for @Test methods inside class.

To run classes in specified order, we need to use preserver-order as'true'

 <test name="Regression1" preserve-order="true">
murali selenium
  • 3,847
  • 2
  • 11
  • 20