UiPath Object Repository

Aarati Navale
Globant
Published in
7 min readMar 21, 2024

In this article, we will explore the concept of Object Repository in UiPath, a fundamental tool that can significantly enhance the efficiency and effectiveness of your automation projects. UiPath processes that use UI automation can be challenging. This is especially true when dealing with frequent changes in UI elements. That’s why UiPath Version 2021.10 introduces the Object Repository. This new feature makes managing, storing, and reusing UI elements in automation projects easy.

UiPath Object Repository can be used to make and reuse UI classification information in an automation project. You can capture UI elements as objects in a DOM-like repository. This repository handles web pages and XML documents in a structured manner. It creates a tree-like structure where a document part is an object. This makes it simple to use JavaScript to access, modify, and interact with the content. You can use the repository in multiple automation projects. Developers use this tool to change webpage content and structure. They share code across different projects easily. It allows for creating and reusing UI taxonomies inside and across automation projects.

Note: UiPath release 2021.10, by default, enables the Modern Design Experience in all new projects where we can use the Object Repository Panel.

Prerequisites

Object Repository works with UiPath.UIAutomation.Activities package versions 2020.10 and above. It works with projects that use the Modern Design Experience.

The “Use Modern for new projects” toggle controls how new projects look. This toggle is available everywhere. If it’s set to Yes, all new projects will have a Modern Design. In this case, activities from the UIAutomation package need to use elements from the Object Repository.

Design settings to enable Modern Design and enforce Object Repository for new workflow

Key Elements of an Object Repository

The essential components of an object repository are UI Descriptors, UI Elements, Screens, UI Applications, and UI Libraries. Let’s look at each one in detail.

  • UI Descriptors -It is a set of selectors that hold information for identifying elements on the screen. They can be used in one project for reuse, a snippets repo for testing, or UI libraries for global project sharing. We extract descriptors from activities. We add them to structured schemas. The schemas group the descriptors by Apps, Versions, Screens, and UI elements.
  • UI Elements -The application comprises full or partial element selectors, anchor selectors, screen captures, and element image capture contexts.
  • Screens -Screens are user interface scopes. They group multiple elements on the same screen. You can get screens from activities in the workflow. You can also generate screens when you capture elements.
  • UI Applications-Applications can be desktop, web, or mobile. Each application can have multiple versions with respective screens.
  • UI Libraries-UI Library encapsulates elements grouped by applications, application versions, and screens. You can extract elements you define as a UI Library. After publishing, you can install it in other projects as a dependency. A UI Library can have multiple applications. However, it can only have one version of certain applications. When you update a dependency, this mechanism also updates the application version in your projects.

The structure of UI libraries is created with the Object Browser hierarchy: Application > Version > Screen > UI Element.

For each application, you achieve the structure shown below. This is an example structure for the GMail app. GMail app is an application with version 1.0.0. The GMail webpage is a screen with three elements: Login-Username, Login-Password, and Next.

Object Repository Hierarchy

How do you use Object Repository?

To create a process with an object repository, we first need to create a project with Modern Design Experience in UiPath studio. Let’s see how we can do that.

General Settings for Modern Design Experience
  1. Let’s use automating the GMail app login page as an example. We will start by using the capture elements wizard to indicate the application.
Object Repository Tab

2. Click on Start recording to add each element and anchor.

Capture element wizard to record screens
Capture Elements by indicating the Chrome GMail login screen.

3. Once you click the Save button after completing all GMail login capture elements, as shown below, all the added elements will be listed under the project UI descriptors tree.

GMail app Object Repository

4. Build the project and drag elements from the Object Repository pane into your workflow. Drag the GMail app’s Username textbox for the username and the Password textbox for the password. Finally, click the Next button. Your workflow is set up for GMail app login.

Design pane workflow generated of recorded screens

5. After creating the workflow, you can publish it by clicking the “Publish” option. If there are changes in the UI element selector later on, you can go to the Object repository of the GMail app and edit the Descriptor, as shown below.

Edit the Descriptor of the element to update the selector

6. To update project selectors, reselect the correct UI element and update any modified selectors due to changes in the application’s user interface. That’s all you need to do.

Indicating the correct Username element

How to Reuse Object Repository?

We can reuse all locally stored elements at the project level. Publish UI libraries locally or on Orchestrator. You can share these libraries with your colleagues and use them in different projects. Extract elements and add them to UI libraries. Then, you can install these libraries as a dependency in your projects. This way, you can reuse them globally.

We can add UI descriptors or libraries to the Snippets panel to save into and pass applications between projects. From Snippets, you can add applications to your local project repository.

Add UI descriptors or libraries to Snippets and use objects in other local projects

Suppose you need a new process that performs different tasks in the same application. We already have elements captured in the UI Object repository.

Click on the Extract as UI Library Project icon.

Extract as UI Library Project

You will be prompted to create a new UI Library. Please name and save it to your desired location and click Create.

Create a New UI Library with the Name-ChromeGMailapp.Descriptor
Open Prompt after successfully creating the GMail app Library

Open the project library created, click the Publish button, and choose where to publish it. You have two options: publishing it on Orchestrator or locally. After publishing the process locally, you will receive a .nupkg package file. This file can be used in other projects, transferred, sent, or uploaded to Orchestrator.

Publish UI Library from Studio
Select the Publish options to Publish the UI library

If you want to publish to Orchestrator, ensure your Orchestrator is configured this way: Go to Tenant -> Settings -> Deployment and in Libraries part set up.

Orchestrator Setting to add Library

To ensure a seamless publication from Studio to Orchestrator, follow the above steps.

Users can now easily install the Descriptors Package from the Manage Packages options, as shown in the image below. Make sure your Studio is connected to this Orchestrator.

Manage Packages option

In Manage Packages, choose Setting, Select the folder path where you have published the GMail app descriptor .nupkg file. Click “Add” and then install the descriptor.

Manage Packages Setting page to Add GMail app descriptor from the local folder path
Install Descriptor package from Manage Packages

Drag and drop the descriptor of the GMail app to the new project you want to create in the order you need, and the project will be ready within very little time by reusing the descriptors.

GMail app Descriptor Package version 1.0.1

Consider how quickly you can create a process by reusing elements already defined in the object repository and keeping them updated whenever a UI element changes. We can easily upgrade applications and process UI elements with UI libraries in one go.

Limitations

Developers should consider the following constraints when building projects with an Object Repository. This will help create a more reliable solution.

  • It is not available in cross-platform projects.
  • If two developers create two objects for the same element, developers cannot recognize duplicate objects. Therefore, developers should refrain from doing this.

Conclusion

The Object Repository is a useful tool in UiPath. It helps you automate processes and improve the reliability and efficiency of your automation. It makes it easier to manage and maintain your automation. This allows you to focus on creating efficient and high-quality automation.

References

  1. Studio: About Object Repository
  2. UiPath Forum

--

--