TESTNG Execution Hierarchy| How TestNG Executes different annotations?


TestNG Execution Hierarchy

TestNG follows following execution hierarchy.

  1. Suite
  2. Test
  3. Class
  4. Method




Take a quick look at practical application of TestNG Annotation on Eclipse IDE

TestNG, TestNGAnnotaions,SoftwareTesting



Examples:

Lets explore the use case in various conditions

Condition 1 >> I  want to open my chrome browser once before all the @test from a class
= In this case I will write the selenium code to open the chrome browser in @BeforeClass method

Condition 2 >> I  want to open an specific URL before each test from a class 
= In this case I will write the selenium code to open the URL in @Beforemethod




Comments