← Quiz: TestNG: all 10 questions
Quiz: TestNG · Question 7 of 10
What is the difference between a hard and a soft assertion?
What is the difference between a hard and a soft assertion?
- A.A hard assertion stops the test at the first failure; a soft assertion collects failures and reports them at assertAll()
- B.Soft assertions never fail
- C.Hard assertions only work with numbers
- D.There is no difference
Answer & explanation
Correct answer: A hard assertion stops the test at the first failure; a soft assertion collects failures and reports them at assertAll()
Soft assertions suit pages with many independent checks.
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 →