🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.A hard assertion stops the test at the first failure; a soft assertion collects failures and reports them at assertAll()
  2. B.Soft assertions never fail
  3. C.Hard assertions only work with numbers
  4. 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 →