- Release Notes
- Getting Started
- Setup and Configuration
- Automation Projects
- Dependencies
- Types of Workflows
- File Comparison
- Automation Best Practices
- Source Control Integration
- Debugging
- The Diagnostic Tool
- Workflow Analyzer
- About Workflow Analyzer
- ST-NMG-001 - Variables Naming Convention
- ST-NMG-002 - Arguments Naming Convention
- ST-NMG-004 - Display Name Duplication
- ST-NMG-005 - Variable Overrides Variable
- ST-NMG-006 - Variable Overrides Argument
- ST-NMG-008 - Variable Length Exceeded
- ST-NMG-009 - Prefix Datatable Variables
- ST-NMG-011 - Prefix Datatable Arguments
- ST-NMG-012 - Argument Default Values
- ST-NMG-016 - Argument Length Exceeded
- ST-DBP-002 - High Arguments Count
- ST-DBP-003 - Empty Catch Block
- ST-DBP-007 - Multiple Flowchart Layers
- ST-DBP-020 - Undefined Output Properties
- ST-DBP-021 - Hardcoded Timeout
- ST-DBP-023 - Empty Workflow
- ST-DBP-024 - Persistence Activity Check
- ST-DBP-025 - Variables Serialization Prerequisite
- ST-DBP-026 - Delay Activity Usage
- ST-DBP-027 - Persistence Best Practice
- ST-DBP-028 - Arguments Serialization Prerequisite
- ST-USG-005 - Hardcoded Activity Arguments
- ST-USG-009 - Unused Variables
- ST-USG-010 - Unused Dependencies
- ST-USG-014 - Package Restrictions
- ST-USG-020 - Minimum Log Messages
- ST-USG-024 - Unused Saved for Later
- ST-USG-025 - Saved Value Misuse
- ST-USG-026 - Activity Restrictions
- ST-USG-027 - Required Packages
- ST-USG-028 - Restrict Invoke File Templates
- ST-USG-032 - Required Tags
- ST-USG-034 - Automation Hub URL
- Variables
- Arguments
- Imported Namespaces
- Coded automations
- Introduction
- Registering custom services
- Before and After contexts
- Integrating OpenAI with Coded Workflows
- Apply for a loan with UiBank
- Queue generation with coded workflows and Orchestrator APIs
- Using imported library projects in coded automations
- Trigger-based Attended Automation
- Recording
- UI Elements
- Control Flow
- Selectors
- Object Repository
- Data Scraping
- Image and Text Automation
- Citrix Technologies Automation
- RDP Automation
- Salesforce Automation
- SAP Automation
- VMware Horizon Automation
- Logging
- The ScreenScrapeJavaSupport Tool
- The WebDriver Protocol
- Test Suite - Studio
- Extensions
- About extensions
- SetupExtensions tool
- UiPathRemoteRuntime.exe is not running in the remote session
- UiPath Remote Runtime blocks Citrix session from being closed
- UiPath Remote Runtime causes memory leak
- UiPath.UIAutomation.Activities package and UiPath Remote Runtime versions mismatch
- The required UiPath extension is not installed on the remote machine
- Screen resolution settings
- Group Policies
- Cannot communicate with the browser
- Chrome extension is removed automatically
- The extension may have been corrupted
- Check if the extension for Chrome is installed and enabled
- Check if ChromeNativeMessaging.exe is running
- Check if ComSpec variable is defined correctly
- Enable access to file URLs and Incognito mode
- Multiple browser profiles
- Group Policy conflict
- Known issues specific to MV3 extensions
- List of extensions for Chrome
- Chrome Extension on Mac
- Group Policies
- Cannot communicate with the browser
- Edge extension is removed automatically
- The extension may have been corrupted
- Check if the Extension for Microsoft Edge is installed and enabled
- Check if ChromeNativeMessaging.exe is running
- Check if ComSpec variable is defined correctly
- Enable access to file URLs and InPrivate mode
- Multiple browser profiles
- Group Policy conflict
- Known issues specific to MV3 extensions
- List of extensions for Edge
- Extension for VMware Horizon
- SAP Solution Manager plugin
- Excel Add-in
- Troubleshooting
Studio User Guide
Using imported library projects in coded automations
This tutorial shows you how to use objects from imported library projects within coded automations. The example demonstrates how to use Object Repository elements and workflows from an imported library project. The given scenario involves automating the Acme website, to fill in a student score card and add it to the database.
- Install UIAutomation Activities
version 23.10.13 or higher.
Note: We recommend you to use the latest minor version corresponding to the major version that you are working with. For example, if you are using the 23.10 major version of activity packages, we recommend you to upgrade them to the latest minor version available (
23.10.x
). - Publish the Acme library sample and install it in the project where you are working.
.xaml
) or coded workflow (.cs
) within the
library project, that you will later use within another coded automation.
- Create a library project named
AcmeLibrary
. - Capture all the UI elements that you want to use inside the Object Repository, and Descriptors section.
- Create a new Coded Workflow, from the File group.
This step is crucial to enable access to the Object Repository within a coded automation when importing the library in another project.
- Rename the Main low-code
workflow to
Send message box
, and add a Message box activity, with the following text: "You've added a new score card for a student in Acme."Note: You can recreate the Message Box activity as a coded workflow, as well, by following the steps outlined in the tutorial. - Save and publish the library project to a feed.
You will install and use this published library in another project within a coded automation.
.xaml
) or coded (.cs
).
IScreenDescriptor
or
IElementDescriptor
are intended to work with Object
Repository elements, while the overloads with
TargetAnchorableModel
are meant for use with native
selectors obtained through the UI Explorer. Visit UI Automation APIs to learn how to
leverage selectors with UI Automation APIs.
- From the File group, create a new Coded Workflow.
- Go to Manage Packages and install the library project you previously created.
- From the File group,
create a new Workflow.
- Name the workflow
notifyStudentScoreCardAdded
. - Navigate to the Activities panel, to the Installed section.
- Search for the name of
the library project you imported (for this example,
AcmeLibrary
). - Drag and drop the
Send message box
activity insidenotifyStudentScoreCardAdded
.Now thenotifyStudentScoreCardAdded
has the same behavior as theSend message box
workflow from the imported library project.
- Name the workflow
- To enhance readability, you can
define your imported Object Repository application as a variable applying a
using
statement at the beginning of your workflow. Here is an example:using app = <ProjectName>.ObjectRepository.Descriptors
.With this approach, you can easily call descriptors in the following format:app.<AppName>.<ScreenName>.<UiElementName>
For this example, we define the Acme Object Repository like the following:namespace UsingImportedLibraryProjects { using AcmeApp = AcmeLibrary.ObjectRepository.Descriptors;
namespace UsingImportedLibraryProjects { using AcmeApp = AcmeLibrary.ObjectRepository.Descriptors; - Now you can automate the given
scenario within Acme. Start by opening the Acme login screen using the
Open API.
[Workflow] public void Execute() { // 1.Open the Acme app on the Login screen var AcmeLoginScreen = uiAutomation.Open(AcmeApp.Acme.LoginScreen);
[Workflow] public void Execute() { // 1.Open the Acme app on the Login screen var AcmeLoginScreen = uiAutomation.Open(AcmeApp.Acme.LoginScreen); - Type in the necessary credentials for logging into Acme, using the
TypeInto API.
// 2.Type in the necessary credentials AcmeLoginScreen.TypeInto(AcmeApp.Acme.LoginScreen.Email, "john.doe2023@uipath.com"); AcmeLoginScreen.TypeInto(AcmeApp.Acme.LoginScreen.Password, "12345678");
// 2.Type in the necessary credentials AcmeLoginScreen.TypeInto(AcmeApp.Acme.LoginScreen.Email, "john.doe2023@uipath.com"); AcmeLoginScreen.TypeInto(AcmeApp.Acme.LoginScreen.Password, "12345678"); - Use the Click API, along with a native selector, to click the
Login button.
// 3.Use a native selector to click the Login button AcmeLoginScreen.Click(Target.FromSelector("<webctrl tag='BUTTON' type='submit'/>"));
// 3.Use a native selector to click the Login button AcmeLoginScreen.Click(Target.FromSelector("<webctrl tag='BUTTON' type='submit'/>")); - The login process takes you to the Dashboard screen in the Acme web
application. Therefore, use the Attach API to focus on the new screen.
// 4. Focus on the Dashboard screen var DashboardScreen = uiAutomation.Attach(AcmeApp.Acme.Dashboard);
// 4. Focus on the Dashboard screen var DashboardScreen = uiAutomation.Attach(AcmeApp.Acme.Dashboard); - Select the Students entry on the website, using the Click API.
// 5. Click the Students entry DashboardScreen.Click(AcmeApp.Acme.Dashboard.Students);
// 5. Click the Students entry DashboardScreen.Click(AcmeApp.Acme.Dashboard.Students); - Select Score card to open the Students - Score Card form, using
the Click API.
// 6. Click Score card, to start filling in a student score card DashboardScreen.Click(AcmeApp.Acme.Dashboard.Students.ScoreCard);
// 6. Click Score card, to start filling in a student score card DashboardScreen.Click(AcmeApp.Acme.Dashboard.Students.ScoreCard); - Focus on the Students - Score Card screen, using the Attach API.
// 7. Focus on the Score Card screen where you fill in the necessary information var ScoreCardScreen = uiAutomation.Attach(AcmeApp.Acme.StudentsScoreCard);
// 7. Focus on the Score Card screen where you fill in the necessary information var ScoreCardScreen = uiAutomation.Attach(AcmeApp.Acme.StudentsScoreCard); - Fill in half of the fields in the Students - Score Card form using the
TypeInto API, and elements from the Object Repository.
ScoreCardScreen.TypeInto(AcmeApp.StudentsScoreCard.StudentEmail, "john.doe@uipath.com"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.FirstName, "John"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.LastName, "Doe"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.ParentEmail, "johnny.doe@uipath.com"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.Tuition, "Private");
ScoreCardScreen.TypeInto(AcmeApp.StudentsScoreCard.StudentEmail, "john.doe@uipath.com"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.FirstName, "John"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.LastName, "Doe"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.ParentEmail, "johnny.doe@uipath.com"); ScoreCardScreen.TypeInto(AcmeApp.Acme.StudentsScoreCard.Tuition, "Private"); - Fill in the rest of the fields in the form using the TypeInto API in
combination with native selectors that you discover through the UI Explorer.
ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='mathematics' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='physics' tag='INPUT' />"), "B"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='biology' tag='INPUT' />"), "C"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='chemistry' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='geography' tag='INPUT' />"), "C"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='history' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='english' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='computer Science' tag='INPUT' />"), "C"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='professorComments' tag='INPUT' />"), "The student is doing okay, very hardworking and does its best");
ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='mathematics' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='physics' tag='INPUT' />"), "B"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='biology' tag='INPUT' />"), "C"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='chemistry' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='geography' tag='INPUT' />"), "C"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='history' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='english' tag='INPUT' />"), "A"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='computer Science' tag='INPUT' />"), "C"); ScoreCardScreen.TypeInto(Target.FromSelector("<webctrl id='professorComments' tag='INPUT' />"), "The student is doing okay, very hardworking and does its best"); - Select Add score card details using the Click API.
// 10. Click the "Add score card details" button using an Object Repository descriptor ScoreCardScreen.Click(AcmeApp.Acme.StudentsScoreCard.AddScoreCardDetailsButton);
// 10. Click the "Add score card details" button using an Object Repository descriptor ScoreCardScreen.Click(AcmeApp.Acme.StudentsScoreCard.AddScoreCardDetailsButton); - Invoke the workflow you imported from the library project using the
RunWorkflow()
method. Provide the method with the path of the workflow inside the project.// 11. Invoke imported workflow from library RunWorkflow("notifyStudentScoreCardAdded.xaml");
// 11. Invoke imported workflow from library RunWorkflow("notifyStudentScoreCardAdded.xaml"); - Close the browser tabs you opened to automate the scenario, using the
Dispose()
API.// 12. Close the applications/browsers you opened, to finish he automation ScoreCardScreen.Dispose();
// 12. Close the applications/browsers you opened, to finish he automation ScoreCardScreen.Dispose();
To follow the steps and try out the tutorial yourself, see the following sample project: Using imported library projects in coded automations. The file contains the library project, as well.