← All topics
Quiz: TestNG: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. Which annotation runs before EVERY test method?
- Q2. A @DataProvider returns 3 rows. How many times does the linked @Test run?
- Q3. What happens if you forget soft.assertAll()?
- Q4. How do you run only the smoke group from Maven?
- Q5. Why use @AfterMethod(alwaysRun = true) for driver.quit()?
- Q6. Which annotation runs once before all the tests in a class?
- Q7. What is the difference between a hard and a soft assertion?
- Q8. How do you check that a method throws an exception in TestNG?
- Q9. What is a TestNG listener used for?
- Q10. What does <suite parallel="methods" thread-count="4" do in testng.xml?