Validate text presence

A crucial part of testing is confirming that the correct information is displayed to the user. You can easily add an assertion step to your test to validate that specific text is present on the screen.

Test Steps:

  1. Select the Element: In recording or inspection mode, click on the text element you wish to verify on the device screen. The element will be highlighted with a green border.

  2. Choose the Validation Action: From the context menu that appears, select "Validate this text presence on screen".

  3. Configure the Assertion: A panel will open on the right, allowing you to configure the validation step.

    • Text or Regex to Assert: This is pre-filled with the text from your selected element (e.g., "Featured article"). You can modify this or use a regular expression.

    • Match Type: Choose between an Exact match or a Regex (regular expression) match.

    • Comparison: Define the assertion condition, such as checking if the text is Visible.

    • Execution: Configure what should happen On Failure and set a Time out period for the test to wait for the element to appear.

  4. Save the Step: Click Save to add the assertion to your test flow. This step will now pass if the specified text is found on the screen during the test run, and fail otherwise.

Using Regex to validate text presence

Select the regex to match the text with the regex pattern

Not sure how to write the regex? Use the help of Finalrun AI to generate Regex. Click on Write Regex with AI and describe the text pattern you want to match on the screen.

Last updated