Managing Locators
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Managing Locators

  • Dark
    Light
  • PDF

Article Summary

Locators let you uniquely identify every web part of an application under test.

Since websites can be constructed according to different hierarchies and structures, locators come in handy to support specific use cases and scenarios and increase your script's resilience to application changes over time. Our codeless scriptBuilder allows us to specify one or multiple selectors that will assist in locating and selecting the most particular web element in the application under test.

Panaya's AI leverages smart algorithms to select locators in real time, with the highest likelihood of success. This is particularly handy when testing SAP applications, where Panaya has developed extensive expertise and a deep knowledge of the underlying technologies. Should an instruction fail due to a locator-related issue, you can directly interact with the locator’s settings and adjust them. This includes the options to edit, delete, or create your own locators.

Supported selectors are CSS and XPath, among others.

Editing Locators

To review captured locators, click the edit button for the relevant instructions. Then click on Manage Locators.


Panaya displays the list of locators intelligently selected as the most fit to identify the element.
Panaya displays the status, type, and additional information for each locator.
You can add additional locators, edit or delete locators, change the order, and check the validity of locators in the locators view.
To edit a locator, use the value field input box, which supports using parameters and functions to allow more flexibility by enabling dynamic changes with adaptive locators.

Turning locators on or off

You can turn the originally captured locators on or off.
Panaya may suggest one or more locators. If one locator appears stronger than others, you can disable weaker locators and keep the stronger one(s).

Checking Locators

To validate whether the defined locators succeed in identifying the correct element, click the Check locators button. Panaya will check all locators as they are defined in the locators section in the Script Builder.
Locators are searched by their order. Finding one locator is enough for Panaya to mark the instruction as complete.

Adding Locators

To add new locators, click on the Add button.

Select the locator Type and then type or paste the locator value.

Use the Check locator button to validate that the new locator succeeded to identify the correct element. Set an optional description for the locator, and click the Save button.

Panaya saves the metadata for each locator, including the user who created it and the date and time. These details may assist when troubleshooting issues and in case of changes in the application UI.

Rearranging locator hierarchy

To rearrange the order of locators, use the Up and Down buttons. Locators are searched by their order. Finding one locator is enough for Panaya to mark the instruction as complete. You can rearrange the order of locators in cases where one locator is consistently more stable than others. In these cases, it is recommended that the stronger locator be positioned before others to improve performance.

Deleting Locators

To delete locators, use the Delete button. Deleted locators cannot be restored.

Supported locator languages and attributes

Supported expression languages and HTML attributes for locator fine-tuning are -

  • XPath

  • CSS

  • ID

  • Name

  • Tag name

  • Class

  • Link text

  • Partial link test