Test your TestNG knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.
Question 1/5Score 0
What is the purpose of TestNG's `@BeforeMethod` and `@AfterMethod` annotations?
Questions in this quiz
What is the purpose of TestNG's `@BeforeMethod` and `@AfterMethod` annotations?
What does TestNG's built-in support for "data providers" (`@DataProvider`) enable?
What does the `invocationCount` attribute (e.g. `@Test(invocationCount = 5)`) do on a TestNG test method?
Why might integration tests specifically benefit from TestNG's explicit dependency (`dependsOnMethods`) and grouping features more than typical isolated unit tests would?
What is a "test suite" in TestNG terminology, as distinct from an individual "test class" or "test method"?
What does the `enabled` attribute (e.g. `@Test(enabled = false)`) do on a TestNG test method?
What is the purpose of TestNG's `@BeforeClass` and `@AfterClass` annotations, and how do they differ from `@BeforeMethod`/`@AfterMethod`?
What is a `testng.xml` file used for?
What is a general tradeoff to consider when using `dependsOnMethods` to chain TestNG tests together, compared to writing fully independent test methods?
What does an `@Test(expectedExceptions = SomeException.class)` annotation configuration do in TestNG?
What is TestNG?
What is the relationship between TestNG and Selenium, when TestNG is used for web UI test automation?