Manage repository items
Once they’re part of your repository, you have several ways to edit and manage repository items can be edited and managed. This chapter describes the options available.
Rename repository items
Ranorex Studio assigns repository items names automatically based on what the corresponding UI elements are called within the tracked application. Sometimes, these names can be cryptic or too generic, making it hard to navigate the repository. You can rename repository items to make it clearer what they do.
Renaming repository items
Rename the repository item and press Enter.
The name of the repository item has been changed.
Copy/move/delete repository items
Repository items can be copied, moved, and deleted as usual. However, moving and deleting can cause issues if:
- you move repository items across logical boundaries in the repository.
- you delete repository items that are linked to one or more actions.
Moving across logical boundaries
Ranorex organizes repository items in logical groups called folders. A folder always contains references to UI elements which share the same base position in the UI. This concept is explained in detail in the chapter ⇢ Structure repository items.
When you move a repository item from one folder to one with a different base path, you also alter the repository item’s base path. As a result, Ranorex likely won’t be able to find the UI element anymore and any actions linked to this repository item will fail during test execution. Ranorex will ask you for confirmation when you attempt to move an item in such a way.
Moving repository items across logical boundaries
…Ranorex will inform you about the consequences and ask you for confirmation.
Deleting a linked repository item
When you delete a repository item that’s linked to one or more actions, the actions will stop working. If you want to remove unused repository items, use the Cleanup function instead
Deleting a repository item
The repository item is removed from actions it was linked to. The actions won’t work anymore.
When a repository item is created, a screenshot of the corresponding UI element is also saved. It can be viewed in the repository. When the UI element changes in appearance, you may need to update it. The option Update screenshot allows you to do this quickly without having to retrack the UI element.
Updating a repository item screenshot
- Right-click the repository item whose screenshot you want to update
- Click Update screenshot
- The screenshot can only be updated if the path for the UI element is still valid and the containing application is running, with the UI element visible. If this isn’t the case, an error message is displayed.
Sometimes it can be hard to determine exactly which UI element a repository item references. When you click Highlight element, Ranorex Studio will highlight the UI element in the containing application. Of course, this will only work if Ranorex Studio can find the element, i.e. if the containing application is running and the path to the element is correct.
Highlighting a repository item
- Right-click the desired repository item.
- Click Highlight element.
The UI element is highlighted in the application for a few seconds with a blinking red frame.
Search for corresponding UI element
- Sometimes Ranorex may take a while to find the corresponding UI element.
- If the path is incorrect or the containing application hasn’t been started, Ranorex won’t be able to find the element.
Add validation screenshot
This option is useful for ⇢ image validations. Normally, when you record an image validation, the validation screenshot will be created automatically. However, you can also add the validation screenshot manually. You can also add several validation screenshots to a single repository item. This is useful when image-validating the same UI element in different states (for example, a traffic light status field). The option Add validation screenshot lets you do this.
Creating a validation screenshot
Click Add validation screenshot.
A screenshot of the current state of the UI element is added to the corresponding repository item.
Once a validation screenshot has been added to a repository item, you can save it to any destination on your system. You can then restore the saved screenshot using the ⇢ image editor.
Saving a repository screenshot
In large test projects, a repository item may be referenced in many modules and/or pieces of code. That’s why it can make sense to check where exactly the repository item is used before you make changes to it. The two context menu options Find test module references and Find code references allow you to do so.
Find test module references
This option shows you all test modules where the repository item is referenced.
Click Find test module references.
The references appear in the search results at the bottom of Ranorex Studio.
Finding code references
This option shows you all code instances where the repository item is referenced.
Click Find code references and select one of the two options.
The code references are displayed in the search results at the bottom of Ranorex Studio.
Repository item properties
Each repository item also has a set of properties that can be configured in its Properties panel.
Opening repository item properties
The properties open to the right of the repository.
List of properties
|Absolute path||Represents the path to the repository item including the paths of all parent folders. Read-only.|
|Adapter type||Lets you select the adapter type. By default, Ranorex will automatically select the most appropriate adapter.|
|Effective timeout||The sum of all search timeouts applied to the specific repository item and all its parent folders. Read-only.|
|Comment||Lets you add a comment to the repository item.|
|Live element||When the UI element represented by the repository item is live, i.e the AUT is opened and the element visible, this property displays a range of different parameters for it.|
|Name||The name of the repository item.|
|Search timeout||Defines the amount of time Ranorex will search for an element before an exception is thrown.|
|Use ensure visible||When
When set to Default, the property is inherited from the setting Use ‘Ensure visible’ by default in the General settings.
|Use cache||Only available for app folders and rooted folders.
When this is True, Ranorex will cache the UI element represented by the folder upon finding it. This can speed up automation because Ranorex won’t search for the element’s path any longer. However, we recommend you set this to False if the UI element changes regularly. In these cases, caching would slow down the test run and cause a warning message in the report. This is because the cached element would not match the actual element, and Ranorex would search for it using the absolute path. This also applies to folders that return two or more UI elements. Ranorex will always cache the first UI element it finds and the rest would again be searched for using the absolute path, causing slowdowns.
Default values for manually created folders:
App folder: False
Rooted folder: False
Default values for automatically created folders are set according to the technology of the UI element. In most cases, this means False.