← Quiz: TestNG: all 10 questions
Quiz: TestNG · Question 5 of 10
Why use @AfterMethod(alwaysRun = true) for driver.quit()?
Why use @AfterMethod(alwaysRun = true) for driver.quit()?
- A.So the browser closes even if setup or the test failed
- B.To make tests run in parallel
- C.To retry failed tests
- D.It runs the test twice
Answer & explanation
Correct answer: So the browser closes even if setup or the test failed
Otherwise failed runs leave browsers open.
Can you get the rest right without peeking?
Take the timed Quiz: TestNG quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →