Mapping dynamic UI elements | Ranorex
Help CenterUser GuideMapping dynamic UI elements

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.

    How to add your own RanoreXPath weight rule

    You can find a detailed description of how to add your own RanoreXPath Weight Rule in the blog post Automated Testing and Dynamic IDs. You can also share your own rules with the Ranorex community. Just contact us through the Support Query and include your Weight Rule and a short description of it.

    How to add shared RanoreXPath weight rules

    Open ‘RanoreXPath Weight Rules’ editor from settings dialog (Settings -> Advanced -> Edit Path Weights). Copy the specific XML rule from below and paste it to ‘RanoreXPath Weight Rules’ Dialog.

    Rule library

    RxWinForms ControlNet11 Classnames

    RxWeb YUI (Yahoo User Interface Library)

    RxWeb JS Frameworks (ExtJS, Sencha, Ozone Widget ,…)

    RxWeb jQuery


    RxWeb GWT

    RxWeb MS Dynamics CRM

    RxWin32 Random Control IDs