Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

What is the order of execution of the test method based on the different annotations?

Category: TestNG

The test methods in TestNG follow the Suite->Test->Class->Method sequence combined with the Before annotations->Test annotations->After annotations sequence. So, the order of execution is-

@BeforeSuite
@BeforeTest
@BeforeClass
@BeforeMethod
@Test
@AfterMethod
@AfterClass
@AfterTest
@AfterSuite

Leave a Reply

Your email address will not be published. Required fields are marked *