Tip: how to fix “locators did not match any elements…”

How to fix automated UI tests quickly when the layout of the application under test changes.

If you have been using Usetrace, you have probably seen the following error message when running traces: “Step locators did not match any elements on the page”

This error indicates that either the application under test is not working as expected, and we have run into a bug, or the layout of the application under test has changed.

In case we have found a bug, the call to action is to tag the trace as “bug”. You can tag the trace from the editor below the trace name and description. Tagging the trace as a bug will work as documentation to your team of currently open and unfixed bugs. Tagging affects the reports as well, read more from here: http://blog.usetrace.com/reports/

If the layout of the application under test has changed, the trace needs to be updated. You can easily update step’s locators (and the step image) by clicking the “Relocate” button from the step’s locator tab, and then pointing and clicking on a new element in the application under test.

Automated update for duplicated steps

One of the nice things Usetrace does for you when you relocate an element is that it scans through all of your project’s traces and prompts to make the update to all matching steps. This can be a big timesaver if you have the step duplicated in several places.

If you are yet to signup to Usetrace, do it from here.

 

Subscribe to our mailing list

* indicates required

Leave a Reply

Your email address will not be published. Required fields are marked *