0

I have 2 TestNG class containing different tests.

For Eg:

 Class Test1{
      @Test
      public void Amazon(){

      }
 }

 Class Test2{
      @Test
      public void Netflix(){

      }
 }

In the above example Class Test1 & Test2 are two separate files. Now if you execute the project as "Run as TestNG Test" which one will execute first and why?

Thanks.

juherr
  • 5,640
  • 1
  • 21
  • 63
Kiran
  • 23
  • 2
  • 11

1 Answers1

0

The order is not specified by TestNG and may change between TestNG, its plugin or even java version.

But you can imagine it takes classes in the alphabetic order:

  • Test1#Amazon
  • Test2#NetFlix

If you want a strong order between tests, you have to use one or more order features from TestNG like dependsOnMethods, priority, ... Check the documentation.

juherr
  • 5,640
  • 1
  • 21
  • 63