Creating asserts during automation

Updated 4 months ago by SYED A HAMID

What is an Assert?

An Assert is a Boolean expression that is added at a specific point in a test script to validate a condition which will be true unless there is a bug in the program. A test assertion is defined as an expression, which encapsulates some testable logic specified about a target under test.

Asserts in Sofy

Asserts are created when you create Nocode Automated Test.

  1. To validate an Assert function, you should enable Assert mode.  You can do that by clicking the Assert icon in the Action Bar.
  2. When you enter the Assert mode, you will see be a RED icon at the top right of the UI. At this point you able to select any of the individual controls and create assertions to validate existence or non-existence of a control or Text.
  3. The following are explanation of various Assert Rules. As an example, Equals Exact Match. can be used to verify text on a Button or Label. The example below uses Equals Exact Match to ensure SIGN IN button appears on this page. When entering Assert value, you specify the value or use Test Data variable.

  1. The Table below describes how various Assert functions are used in Sofy.

Assert function



Equals exact match

Button, Labels, TextBox

Button must have the exact match as the specified in the Assert

Not Equals Exact match

Button, Labels., TextBox

Must not have not the exact text as specified in the Assert

 Equals Similar

ImageView, ImageButton

The image or icon must be the same and at the exact location

Not Equals Similar

ImageView, ImageButton

The image or icon are not the same nor at the exact location

Exists Similar

ImageView, ImageButton

The image is at the vicinity and not at the exact location. 



The control is checked



The control is Unchecked


Button, TextBox

The control is enabled for data entry or selection

Not Enabled

Button, TextBox

The control is enabled for data entry or selection

Related Video: Adding Asserts in Sofy

How did we do?

Powered by HelpDocs (opens in a new tab)