What are locators and how are they used?

DOM locators are used to find a specific element on a web page.

Steps and checks use locators to find the correct element to interact with. Usetrace uses multiple locators. An element is found when at least one of its locators match the current web page.

Editor retrieves element attributes like name, id, name, xpath, relative xpath and also css when steps and checks are created.

These attributes can then be used for the step or check to find the element one after another until the element is found.

Editing locators

In Editor, click the locator tab on the desired step to change the locator attributes for a step or a check.

The supported locators are:

The locator is used only in case it uniquely identifies the element. If you define a loose locator, for example, a css selector “button”, Usetrace will probably find multiple html elements matching the locator. In that case, Usetrace will not interact with the site. To resolve this, define a more strict locator using some unique attribute, e.g. a css class.