Verify Text in Relation to Other Text
Use Verify Text in Relation to Other Text to confirm that one text string appears near another. This is useful when checking for paired values such as labels and their corresponding data, product names with prices, or key details in tables and summaries.
When to Use
Validate key-value pairs such as:
- Email: user@example.com
- Product X – $30
- Departure — 8:45 AM
Ensure that a label and its value are displayed together
Confirm that related details appear as connected content in tables, grids, or summary sections
Add a "Verify Text in Relation to Other Text" Step
While recording, click the Add a Verification Step icon.
Select Verify text in relation to other text.
Enter the required values:
- Reference Text – The anchor or label (example:
"Product"
) - Related Text – The value that should appear near the reference text (example:
"$30"
)
Optional
Open Advanced Settings to refine how texts are matched, such as enabling regex or ignoring digits.
- Reference Text – The anchor or label (example:
Click Save to add the verification step.
The step is added to the scenario and shown in the Recorder.
In the Features page, it appears as part of the recorded scenario.
Results are displayed on the Reports page after test execution.
Advanced Settings
Advanced settings give more control over how text matches are evaluated. These options help reduce false positives and allow precise validation.
Note
To access these options, enable Make it a regular expression.
You can then apply built-in matching rules or write your own regex patterns.
Setting | What it does | Example |
---|---|---|
Make it a regular expression | Matches using regex syntax. The text entry will have / at both ends. | /Product.*X/ matches Product X, Product Name: X, or Product - X |
Make case insensitive | Ignores case when evaluating matches. | product x matches Product X, PRODUCT X, or ProDuct x |
Ignore digits | Skips digits in the match. | Flight 123 matches Flight, or Flight 456 |
Look for exact match | Requires an exact match, with no extra words or spaces. | Shipping Details must match exactly. It will not match Shipping Details Page or Your Shipping Details |
Best Practices
- Use this verification for data that always appears contextually linked, like labels and values.
- Apply Advanced Settings to make your checks more resilient against formatting or case differences.
- Use regex for dynamic content (for example: product IDs that change per run).
- Combine this assertion with waits if related content appears after an API call or delayed rendering.