Assert! Assert! Add more to your automation script

Let's figure out about Hard Assertions

Sajitha Pathirana
Nerd For Tech

--

Assertions are the guide sticks in test automation. Hence the assertions play the most vital role in test automation to identify issues in the system under test. Adding more and meaningful assertions will offer reliability in the functionality of the application.

More assertions → more checkpoints → more functional validations.

Photo by James Bold on Unsplash

Have you been only using hard assertions all the time? Confused? Let’s figure it out today.

Mainly there are two types of assertions.

  • Hard Assertions
  • Soft Assertions

Hard Assertions will not continue the test script if there is an assertions failure and will fail the script right on the spot where the failure happened. Hard assertions are hard stoppers.

On the other hand, soft assertions would continue the test execution even there are discrepancies and fail after validating all the assertions. Check out more on soft assertions.

--

--

Sajitha Pathirana
Nerd For Tech

A Test automation enthusiast, passionate to help the teams to enhance their testing journey with his decade of experience in the field.