Verify Presence of Substring: VERIFYCONTAINS
The Verify Presence of Substring action checks if a specific text or number is present within a larger value. This action is useful for verifying that a particular word, phrase, or number appears within a given 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: Validate presence of a keyword in displayed text.
Scenario: Let’s verify that the Order Details section on a receipt page contains the word “Confirmed.”
Steps to configure:
- Add a new step.
- Select Verify Presence Of Substring from the Action drop-down.
- In the Screen Name field, select the screen where the LHS element is located (e.g., Receipt Page).
- In the Element Key field, select the element representing the LHS value (e.g., Order Details).
- In the Parameters section, enter the RHS value you want to check for presence (e.g., “Confirmed”).
- Click Save.
Note: While the steps for adding an action command are identical in both views, the display of the steps changes:


Note: Ensure that the Screen Name and Element Key are set up before using this action.
Expected Outcome on execution:
- The Verify Presence of Substring action will check if the LHS value (e.g., the text in Order Details) contains the RHS value (e.g., “Confirmed”).
- If the substring is found, the action will pass, indicating the expected content is present.
- If the substring is not found, the action will fail, signaling that the expected content is missing.
Example 2: Check if a specific phrase/text is present in a given string
Scenario: You want to check if the phrase “Your payment” appears in a system-generated message.
Steps to configure:
- Add a new step.
- Select Verify Presence of Substring from the Action drop-down.
- Leave the Screen Name field blank.
- In the Element Key field, enter the full LHS value (e.g., Your payment was successful).
- In the Parameters section, enter the RHS value to verify (e.g., Your payment).
- Click Save.
Note: While the steps for adding an action command are identical in both views, the display of the steps changes:


Expected Outcome on Execution:
- The action will check if the LHS value contains the RHS substring.
- If found, the step will pass, confirming the expected content is present.
- If not found, the step will fail, indicating a mismatch.