Image of Testim Smart Locators

Testim Smart Locators: Self-Healing Test Scripts Simplified

Table of Contents

Smart locators, also known as self-healing locators in Testim, are mechanisms that help maintain test stability by automatically adapting to UI changes. These features prevent tests from failing due to minor modifications in element attributes or structure.If an element’s primary locator fails, Testim uses alternative locators based on past executions to identify the element.

To Check How Self Healing Works

  • First, run the complete test and check the Locator Score for the element you want to enable self-healing for. Then, go to Element Properties and click on View Locators

  • Now, set a breakpoint at the step where you need to change the locator of an element.

  • Now, go to the Developer Tools, navigate to the HTML section, and modify the element text.

  • Now, run the test. The test will pass even if the Tab Name Text and URL have been changed.
  • After execution, if you see a warning icon on the element, click on it. Otherwise, you can go to Element Properties to check the Locator Score.

  • If you want your test to fail in this case, you need to change the Threshold from Very Low to Strict.

Good to Read:- Assertions in Testim: A Complete Guide to Smart Testing

Related Blogs