Mapping dynamic UI elements
Many applications contain so-called dynamic UI elements. These change whenever a particular event happens, e.g. when you reload a web page. It’s often harder for automated testing tools to find these UI elements reliably. This is because identifiers that are robust for static UI elements (like the element ID) change all the time for dynamic UI elements. This is why you need to fall back on other identifiers for dynamic UI elements.
For web elements, Ranorex Studio uses an intelligent algorithm that recognizes when a UI element is dynamic. It ignores dynamic identifiers and uses a robust, static identifier instead. This means you should normally not need to find and replace dynamic identifiers from your web repository items.
However, for desktop applications and mobile apps, you will need to deal with dynamic identifiers manually. You can either replace them by hand in the RanoreXPaths of your repository items, or you can use RanoreXPath weight rules to optimize object recognition for specific dynamic frameworks.
Using weight rules is the recommended way and in this chapter, you’ll learn how to do so.
In this chapter
What are RanoreXPath weight rules?
A path weight rule sets the weight of a specific attribute for a specific capability meeting a set of defined conditions. The weight will be used when building up the RanoreXPath. The attribute with the highest weight and a value other than empty will be taken for the identification of the UI element.
The RanoreXPath Weight Rules can be accessed via the ‘RanoreXPath Weight Rules’ editor (‘Settings -> Advanced -> Edit Path Weights’ or ‘Ranorex Spy -> Edit Path Weights’).
Using the RanoreXPath Weight Rules can assist you in automatically creating a robust repository which is the base of a robust test automation framework.