All quizzes
Free quiz · 20 questions in the bank

TestNG quiz

Test your TestNG knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.

Question 1/12Score 0

What does the `timeOut` attribute (e.g. `@Test(timeOut = 5000)`) do on a TestNG test method?

In this round
  1. What does the `timeOut` attribute (e.g. `@Test(timeOut = 5000)`) do on a TestNG test method?
  2. What are TestNG "groups," and what problem do they solve?
  3. What is the purpose of TestNG's `@BeforeMethod` and `@AfterMethod` annotations?
  4. Why might integration tests specifically benefit from TestNG's explicit dependency (`dependsOnMethods`) and grouping features more than typical isolated unit tests would?
  5. What is TestNG's built-in support for parallel test execution, and why might it be valuable for a large test suite?
  6. What does the `invocationCount` attribute (e.g. `@Test(invocationCount = 5)`) do on a TestNG test method?
  7. What is a general reason a team working on a large enterprise Java project with complex, interdependent integration tests might specifically favor TestNG over JUnit?
  8. What does the `priority` attribute (e.g. `@Test(priority = 1)`) control on a TestNG test method?
  9. What does an `@Test(expectedExceptions = SomeException.class)` annotation configuration do in TestNG?
  10. What does the `@Test` annotation do in a TestNG test class?
  11. What is the purpose of TestNG's `@BeforeClass` and `@AfterClass` annotations, and how do they differ from `@BeforeMethod`/`@AfterMethod`?
  12. What is a general tradeoff to consider when using `dependsOnMethods` to chain TestNG tests together, compared to writing fully independent test methods?
Gaps to close?
Read the curated TestNG notes — core concepts, patterns, interview prep.
TestNG notes

More quizzes

.NETAccessibilityAgileAgile MethodologyAirflowAkka