Repository items representing multiple elements | Ranorex
Help CenterUser GuideRanorex Studio fundamentals

Repository items representing multiple elements

The concept introduced herein is the option that one repository item may not address and represent one single UI-element, but two or more UI-elements. This feature is commonly used with code modules.

In this chapter

    Necessary context

    The herein introduced concept is commonly used with code modules. Code modules are an expert topic. Therefore, check if this chapter contains knowledge necessary to solve your test challenge.

    Further reading

    The expert topic of code modules is introduced and explained beginning with > Ranorex Studio expert > ⇢ Code modules.

    To understand the herein introduced topic it is further advisable to be familiar with the advanced concept of RanoreXpath and its applications. The example description and notation used is based on this concept.

    Further reading

    The advanced concept of RanoreXPath is introduced and explained beginning with > Ranorex Studio advanced > ⇢ RanoreXPath.

    The Ranorex Spy tool, its functions and wide range of applications may also be a helpful knowledge.

    Further reading

    The Ranorex Spy tool is introduced and explained beginning with > Ranorex Studio advanced > ⇢ Ranorex Spy.

    Example definition

    The purpose of the explanation example herein is to define one repository item which addresses and references two radio buttons within the gender selection region of the database in the demo application.

    Gender selection radion buttons in demo application

    Gender selection radion buttons in demo application

    Repository item tracking

    The way of creating the repository item is way the same as for a regular repository item creation. See the instruction for details.

    Open Ranorex Spy to track a UI-element
    Start the demo application with the Test database register tab
    Track one of the gender selection radio buttons

    Tracking of a radio button in demo application

    Tracking of a radio button in demo application

    Tracked and identified UI-element of female radio button in demo application
    Unique RanoreXPath specification for female radio button in Ranorex Spy
    UI-element browser tree displaying the defined path for the female radio button in Ranorex Spy
    Path editor for female radio button in Ranorex Spy

    Generalization of RanoreXPath specification

    We now generalize the RanoreXPath specification in a way to include the second gender selection radio button of the demo application.

    Change the RanoreXPath specification as shown here

    Generalization of RanoreXPath specification

    Generalization of RanoreXPath specification

    Initially tracked RanoreXPath specification of single female radio button
    Changed, generalized RanoreXPath specification to include both radio buttons

    Multiple repository items detection

    The result of the generalization of the RanoreXPath specification leads to the simultaneous tracking of both gender selection radio buttons in the demo application which can be seen in Ranorex Spy.

    Multiple repository item tracking

    Multiple repository item tracking

    Positive match of two tracked radio buttons
    Found elements information in Ranorex Spy

    Found elements information in Ranorex Spy

    Ranorex Spy displays the match result in the lower left corner of the working environment

    Adding tracked item to the repository

    Finally, the matched items are to be added to the repository.

    Adding matched item to repository

    Adding matched item to repository

    Select one of the matched repository items, open the context menu and click Add to repository

    Naming generalized repository item

    The generalized repository item can be renamed as any other repository item.

    Renaming of generalized repository item

    This is the caption of the image

    Select the repository item representing multiple UI-elements
    See the changed repository item name