Fuzzy Logic and Regex Locators

On certain dynamic sites, using strict locators is most of the time challenging and also changing. A strict locator is a locator of an element that should match complete an attribute or a text, meaning it should always match ID or class, etc, or with the complete text of the element.

Test Designer offers the use of Fuzzy and Regex Locators which will help in handling any dynamic contents of any web application.

Example:

Below is one example of a dynamic locator where the heading would keep changing.

heading1("Build office's profile")

Edit the recorded step to replace the accessor with the right expected text value, or a portion of it using the square brackets or in Regex

heading1(["This is a significative portion of the expected text"]) //This is Fuzzy Logic

or

heading1(/.*This is a significative portion of the expected text./); // IMPORTANT: Regular Expression SHOULD NOT be enclosed in quotes, otherwise will be treated as a string }}