Reputation: 11
If we use all annotations of TestNG in our program, which annotation will be executed first? Please clear my doubt that actually asked in interview.
Upvotes: 0
Views: 307
Reputation: 1333
Following execution sequence will be followed when a TestNG test executes
@BeforeSuite
@BeforeTest
@BeforeClass
@BeforeMethod
@AfterMethod
@AfterClass
@AfterTest
@AfterSuite
So to answer your question @BeforeSuite is the first annotation to be executed.
Upvotes: 1