Skip to content

Verify Absence of Substring: VERIFYNOTCONTAINS

The Verify Absence of Substring action checks if a specific text or number is not present within a larger value. This action is useful for verifying that certain words, phrases, or numbers do not appear in an element’s text. The left-hand side (LHS) value is taken from an element on the screen, while the right-hand side (RHS) value is entered in the parameter section. The RHS can be a hard-coded value or a variable. If a locator (page and element) is provided, the LHS will be the text found at that locator.

Example 1: Check if a keyword is absent from UI text.

Scenario: Let’s verify that the Order Summary section on a receipt page does not contain the word “Cancelled.”

Steps to configure:

  1. Add a new step.
  2. Select Verify Absence Of Substring from the Action drop-down.
  3. In the Screen Name field, select the screen where the LHS element is located (e.g., Receipt Page).
  4. In the Element Key field, select the element representing the LHS value (e.g., Order Summary).
  5. In the Parameters section, enter the RHS value you want to confirm is absent (e.g., “Cancelled”).
  6. Click Save.

Note: While the steps for adding an action command are identical in both views, the display of the steps changes:

scrn-Verify-Absence-of-Substring-Tabular-View
Tabular View
scrn-Verify-Absence-of-Substring-Card-View
Card View

Note: Ensure that the Screen Name and Element Key are set up before using this action.

Expected Outcome on execution:

  • The Verify Absence of Substring action will check if the LHS value (e.g., the text in Order Summary) does not include the RHS value (e.g., “Canceled”).
  • If the substring is absent, the action will pass, confirming that the unwanted text or value is not present.
  • If the substring is found, the action will fail, indicating that the undesired content is present.

Example 2: Substring absence check using string values only

Scenario: You want to confirm that the phrase “error” does not appear in the system message “Your changes have been saved successfully.”.

Steps to configure:

  1. Add a new step.
  2. Select Verify Absence of Substring from the Action drop-down.
  3. Leave the Screen Name field blank.
  4. In the Element Key field, enter the full LHS string (e.g., Your changes have been saved successfully).
  5. In the Parameters section, enter the RHS value to check for absence (e.g., error).
  6. Click Save.

Note: While the steps for adding an action command are identical in both views, the display of the steps changes:

scrn-Verify-Absence-of-Substring-string-Tabular-View
Tabular View
scrn-Verify-Absence-of-Substring-string-card-View
Card View

Expected Outcome on Execution:

  • If the LHS value does not contain the RHS substring, the action will pass.
  • If the RHS substring is found, the action will fail, indicating unexpected or unwanted content is present.

Back To Top