Selecting the right element on my screen but still getting test failure

Updated by Aishwarya Rai

This may happen when the App design does not have the proper elements structure in place to support automation.

Having a unique identifier for each element (ex: button, icon, etc.) that you intend to interact with during your test, results in building resilient test cases. These unique identifiers include, description, resource ID, text, etc. When unique identifiers are not present and automation only relies on Xpath for selecting a specific element, the test cases are not resilient. The reason being, an Xpath is generated dynamically and is subject to change.

What we recommend:

We recommend that you inform the developers on your team to populate the elements with some level of unique identifiers to enable resilient automation of your test cases.


How did we do?