Skip to main content

Introduction

We need assertions in order to know if our test execution was successful or not. If we do not add assertions in our test cases, the values for Passed and Failed will be zero. A test case can have more than one assertion.

Solution

Assertions can be added by using the Add Assertion action. You can choose from the following types of assertions:
Assertion TypeDescription
Element Is PresentChecks if an element is present.
Element Is Not PresentChecks if an element is not present.
Element Is VisibleChecks if an element is visible.
Element Is Not VisibleChecks if an element is not visible.
Element Is ClickableChecks if an element is clickable.
Element Is Not ClickableChecks if an element is not clickable.
Element Matches ValueChecks if the text from an element matches a certain value.
Element Does Not Match ValueChecks if the text from an element does not match a certain value.
Element Contains ValueChecks if the text from an element contains a certain value.
Element Does Not Contain ValueChecks if the text from an element does not contain a certain value.
Element Contains CSS ClassChecks if an element contains a certain CSS Class Name.
Element Does Not Contain CSS ClassChecks if an element does not contain a certain CSS Class Name.
Element Contains AttributeChecks if an element contains a certain attribute.
Element Does Not Contain AttributeChecks if an element does not contain a certain attribute.
Count Child ElementsChecks if the number of direct child elements matches a certain number.
Variable AssertionProvides multiple ways to check a variable.
Title Contains ValueChecks if the title of the web page contains a certain value.
Title Does Not Contain ValueChecks if the title of the web page does not contain a certain value.
URL Contains ValueChecks if the URL of the web page contains a certain value.
URL Does Not Contain ValueChecks if the URL of the web page does not contain a certain value.
Page Source Contains ValueChecks if the Page Source of the web page contains a certain value.
Page Source Does Not Contain ValueChecks if the Page Source of the web page does not contain a certain value.
Cookies Contain ValueChecks if the Cookies contain a certain value.
Cookies Do Not Contain ValueChecks if the Cookies do not contain a certain value.
Browser Logs Contain ValueChecks if the Browser Logs contain a certain value.
Browser Logs Do Not Contain ValueChecks if the Browser Logs do not contain a certain value.
Page Matches ScreenshotPerforms a visual comparison between the viewport and a baseline screenshot.
Full Page Matches ScreenshotPerforms a visual comparison between the entire page and a baseline screenshot.
Element Matches ScreenshotPerforms a visual comparison between an element and a baseline screenshot.