Assertion Step
Validate your test results. Is the element visible? Is the text correct? Is the URL as expected? Add validation to your tests with Assertion.
What is Assertion?
Assertion checks whether the expected condition has occurred at a specific point in the test. If the assertion fails, the test is marked as FAILED.
Why is Assertion Important?
Without assertion, the test only executes the steps but does not check whether it produces the correct result. Assertion determines whether the test is truly successful.
Assertion Step Dialog
Assertion type and parameters
Assertion Types
EQUALS
Passes if the values are exactly equal.
NOT_EQUALS
Passes if the values are not equal.
CONTAINS
Passes if the value includes the expected.
NOT_CONTAINS
Passes if the value does not include it.
STARTS_WITH
Passes if the value starts with the expected.
ENDS_WITH
Passes if the value ends with the expected.
IS_EMPTY
Passes if the value is empty or blank.
IS_NOT_EMPTY
Passes if the value is not empty.
GREATER_THAN
Passes if the value is greater than expected.
LESS_THAN
Passes if the value is less than expected.
IS_NULL
Passes if the value is null or undefined.
IS_NOT_NULL
Passes if the value is not null or undefined.
Frequently Asked Questions
What happens if an assertion fails?
The test is marked as FAILED and subsequent steps do not run (hard assertion). If you use soft assertion, the test continues but the result will be failed.
How many assertions should a test have?
At least one assertion is recommended for each critical step. However, too many assertions can slow down the test. Maintain a balance.