What are commonly used TestNG annotations?

What are commonly used TestNG annotations?

Hey Ian,

The commonly used TestNG annotations are-

  • @Test: Marks a method as a test method.
  • @BeforeSuite: Runs once before all tests in the suite.
  • @AfterSuite: Runs once after all tests in the suite.
  • @BeforeClass: Runs once before the first test method in the class.
  • @AfterClass: Runs once after all test methods in the class.
  • @BeforeTest: Runs before any test method in the tag.
  • @AfterTest: Runs after all test methods in the tag.
  • @BeforeMethod: Runs before each method marked with @Test.
  • @AfterMethod: Runs after each method marked with @Test.
  • @DataProvider: Passes test data to the test method, executing based on the number of data rows provided.

Feel free to reach out for more clarification.