Skip to content
Testsigma DOCS

Elements

Locator Precedence in Test Recorder


While creating tests for web applications, identifying locators accurately for UI elements is important. In Testsigma, you can enhance this process by defining locator precedence on the test recorder. This will prioritize fetching locators such as Link Text, Name, ID, CSS Selector, and XPath based on the priority specified on the recorder, which selects the static and unique locator. This prioritization continues until a locator that meets these criteria is identified.


Prerequisites

Before you begin, ensure that:

  • You have installed the Testsigma Chrome Extension. For more information on installing Testsigma Chrome Extension, refer to the documentation on Testsigma Chrome Extension.
  • You have a web application that is available for testing.

  1. From the left navigation bar, go to Create Tests > Elements and click Record. Record

  2. This will open a new window with the test recorder and will be ready to start recording. Here, we entered the URL for Simply Travel Web. Window

  3. On the test recorder, click on Locator precedence. Locator Precedence

  4. This will open the Locator precedence overlay on Recorder. Recorder

  5. Use the Drag Handle to configure the priority of locators. Drag Handle

  1. Click on Save to save the configuration. Save