Once they are 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.
The screencast Manage repository items walks you through information found in this chapter.
Watch the screencast now
Rename repository items
Ranorex Studio assigns repository item 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.
-
Select the repository item and press
F2
. -
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 that share the same base position in the UI. This concept is explained in detail in the chapter on 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.
-
When you move a repository item from one folder to another with a different base path…
-
…Ranorex will inform you about the consequences and ask you for confirmation.
This only applies to app folders and rooted folders. Simple folders are not affected because they don’t have a base path.
Deleting a linked repository item
When you delete a repository item that is linked to one or more actions, the actions will stop working. If you want to remove unused repository items, use the Cleanup function instead
-
Select a repository item and delete it.
-
The repository item is removed from the actions it was linked to. The actions won’t work anymore.
Update screenshot
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.
-
Update screenshot option
- Right-click the repository item whose screenshot you want to update
- Click Update screenshot
-
The screenshot
-
Failure message
- 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.
Highlight element
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, for example, if the containing application is running and the path to the element is correct.
-
Highlight element
- 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 the 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.
-
Right-click the desired repository item.
-
Click Add validation screenshot.
-
A screenshot of the current state of the UI element is added to the corresponding repository item.
This option only works if the AUT is opened and the respective UI element is visible.
Save screenshot
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.
-
Right-click the screenshot and click Save screenshot…
Find references
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.
-
Right-click the desired repository item.
-
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.
-
Right-click the desired repository item.
-
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.
-
Right-click the desired repository item.
-
Click Properties.
-
The properties are 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 set to Yes, forces the UI element the repository item represents to become visible during a test run. For example, the UI element may be at the bottom of a webpage and you would need to scroll to it first to see it. With this property enabled, Ranorex will do this automatically. 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 will 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. |