Use regular expressions in the Web Transaction Recorder
When you create a recording in the Web Transaction Recorder, you can add a text validation step that searches for regular expressions instead of just single words. Also called "regex" or "regexp," you can use this functionality to search for specific strings, groupings, or phrases on web pages. If the match is not successful, WPM sets the transaction status to Down.
Some examples of regular expressions include:
^Old version
: Searches for "Old version" text that appears before other text.Screenshot$
: Searches for the word "screenshot" at the end of text.te*box
: Matches tbox, tebox, teebox, teeebox, teee.......box, and so on.te+xtbox
: Matches textbox, teextbox, teeextbox, teee.......xtbox, and so on.Pas{1,}
: Matches, pas, pass, passs, pass, Passs...., and so on.
For example, use \w+.&.\w+
to search for text created from two words with two white spaces and an ampersand (&) symbol between them, such as "Fish & Chips."
Note the following details about using regular expressions:
- This feature is a subset of the Text Validation feature.
- WPM searches all text on a page, except HTML tags.
- For best results, make Text Validation the first action executed on the page loaded after logging in.
- The more text on a page, the longer time it takes to search the page. Playback may time out.
To learn more, see the Regular Expression Language Quick Reference (© 2020, Microsoft Corp., available at docs.microsoft.com, obtained on April 24, 2020).
To use regular expressions in a recording:
- Click Add text validation .
- In the Add Text Match dialog box, type the text you want WPM to check for.
- Select the "Use regular expression" check box.
- Select a Verify text option, based on whether you want specified text to appear.
- Indicate the time WPM should wait for text to match.
- Click Add.