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
What does the `timeOut` attribute (e.g. `@Test(timeOut = 5000)`) do on a TestNG test method?
What are TestNG "groups," and what problem do they solve?
What is the purpose of TestNG's `@BeforeMethod` and `@AfterMethod` annotations?
Why might integration tests specifically benefit from TestNG's explicit dependency (`dependsOnMethods`) and grouping features more than typical isolated unit tests would?
What is TestNG's built-in support for parallel test execution, and why might it be valuable for a large test suite?
What does the `invocationCount` attribute (e.g. `@Test(invocationCount = 5)`) do on a TestNG test method?
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?
What does the `priority` attribute (e.g. `@Test(priority = 1)`) control on a TestNG test method?
What does an `@Test(expectedExceptions = SomeException.class)` annotation configuration do in TestNG?
What does the `@Test` annotation do in a TestNG test class?
What is the purpose of TestNG's `@BeforeClass` and `@AfterClass` annotations, and how do they differ from `@BeforeMethod`/`@AfterMethod`?
What is a general tradeoff to consider when using `dependsOnMethods` to chain TestNG tests together, compared to writing fully independent test methods?