UiPath — Beginner to Advanced Guide
A structured learning path for RPA developers. Work through each section in order — each builds on the last.
Table of Contents
- What is RPA & UiPath?
- UiPath Studio — Interface & Setup
- Variables, Data Types & Arguments
- Control Flow — Sequences, Flowcharts & Decisions
- User Interface Automation
- Excel & Data Table Automation
- String Manipulation & Regex
- Error Handling & Logging
- PDF, Email & File Automation
- Selectors & UI Explorer
- Orchestrator — Managing Bots at Scale
- Reusable Libraries & Packages
- RE Framework (Robotic Enterprise Framework)
- Advanced Topics
- Best Practices & Certification Tips
1. What is RPA & UiPath?
RPA (Robotic Process Automation) is software technology that uses bots to automate repetitive, rule-based tasks that humans perform on computers — clicking, typing, reading files, filling forms, etc.
UiPath is the leading RPA platform. It has three core products:
| Product | Purpose |
|---|---|
| UiPath Studio | Where you design and build automation workflows |
| UiPath Robot | Executes the workflows (attended or unattended) |
| UiPath Orchestrator | Web portal to deploy, schedule, monitor, and manage robots |
Types of Robots
- Attended Robot — works alongside a human; triggered manually. Used for tasks that need human input mid-process.
- Unattended Robot — runs fully autonomously, triggered from Orchestrator on a schedule or via API.
- Hybrid — combination of both, typically using the RE Framework.
Key Concepts
- Process — an automation workflow you build.
- Job — a single execution of a process on a robot.
- Queue — a list of work items (transactions) stored in Orchestrator for unattended robots to process.
- Asset — configuration values (credentials, URLs, settings) stored securely in Orchestrator.
2. UiPath Studio — Interface & Setup
Installation
- Download UiPath Studio Community Edition (free) from uipath.com.
- Install and sign in with your UiPath account.
- Activate the Community license.
Studio Interface
┌─────────────────────────────────────────────────────────┐
│ Ribbon (Home / Design / Execute / Debug tabs) │
├──────────┬──────────────────────────────┬───────────────┤
│ Project │ │ Properties │
│ Panel │ Designer Canvas │ Panel │
│ │ (drag activities here) │ │
│ Activities│ │ Output Panel │
│ Panel │ │ (logs) │
└──────────┴──────────────────────────────┴───────────────┘
Key Panels
- Activities Panel — all available automation actions (search here).
- Project Panel — your project's file tree.
- Designer Canvas — where you build workflows visually.
- Properties Panel — configure selected activity's settings.
- Output Panel — see log messages when running/debugging.
First Automation — "Hello World"
- Create a new Process project.
- Open
Main.xaml. - Drag a Sequence activity onto the canvas.
- Inside it, drag a Message Box activity.
- Set the
Textproperty to"Hello, UiPath!". - Press F5 to run.
3. Variables, Data Types & Arguments
Variables
Variables store data during execution. Created in the Variables panel at the bottom of the canvas.
| Data Type | Example Value | Use Case |
|---|---|---|
String | "John" | Text data |
Int32 | 42 | Whole numbers |
Double | 3.14 | Decimal numbers |
Boolean | True / False | Flags / conditions |
DateTime | Now | Dates and times |
DataTable | — | Table/spreadsheet data |
Array of [T] | {1, 2, 3} | Lists of same type |
List(Of T) | — | Dynamic lists |
Dictionary(Of K,V) | — | Key-value pairs |
Scope — always set the narrowest scope possible (the container the variable is used in).
Common Variable Operations
' Assign Activity
myString = "Hello " + firstName ' String concat
counter = counter + 1 ' Increment
isValid = (age >= 18) ' Boolean expression
Arguments
Arguments pass data into or out of a workflow (used when calling one .xaml from another).
| Direction | Meaning |
|---|---|
In | Value passed into the workflow |
Out | Value returned from the workflow |
In/Out | Passed in, modified, passed back |
Rule of thumb: use Variables for internal data, Arguments for data crossing workflow boundaries.
4. Control Flow — Sequences, Flowcharts & Decisions
Workflow Types
| Type | Best For |
|---|---|
| Sequence | Linear, step-by-step tasks |
| Flowchart | Decision-heavy processes with branches |
| State Machine | Complex state-driven processes (like RE Framework) |
Decision Activities
If Activity
Condition: age >= 18
Then: [activities if true]
Else: [activities if false]
Switch Activity — like a switch/case statement; branch on a variable's value.
Flow Decision — a diamond-shaped decision node in Flowcharts.
Loop Activities
| Activity | Use Case |
|---|---|
While | Loop while condition is true (check before) |
Do While | Loop while condition is true (check after) |
For Each | Iterate over a collection (list, array, DataTable rows) |
Retry Scope | Retry a block until success or max retries hit |
Example — Loop Through a List
Assign: fruits = New List(Of String) From {"Apple","Banana","Cherry"}
For Each item In fruits
TypeOf item As String
Message Box: item
5. User Interface Automation
UI automation is the core of most RPA workflows — interacting with apps and websites.
How UiPath Identifies UI Elements
UiPath uses Selectors — XML strings that uniquely identify a UI element:
<wnd app='notepad.exe' cls='Notepad' title='Untitled - Notepad' />
<wnd ctrlid='15' />
<ctrl name='Text Editor' role='editable text' />
Key UI Activities
| Activity | What It Does |
|---|---|
Click | Left/right click on any element |
Type Into | Type text into a field (clears first with Empty field option) |
Get Text | Read text from an element |
Set Text | Set text without simulating keystrokes |
Check | Check/uncheck a checkbox |
Select Item | Choose from a dropdown |
Send Hotkey | Press keyboard shortcuts (Ctrl+C, Enter, Tab…) |
Attach Window | Scope activities to a specific window |
Use Application/Browser | Modern UI interaction (Studio 21+) |
Input Methods
| Method | Speed | Background? | Recommended For |
|---|---|---|---|
| Default | Medium | No | General use |
| Simulate | Fast | Yes | Web / simple inputs |
| Window Messages | Fast | Partial | Desktop apps |
| ChromiumAPI | Fastest | Yes | Chrome / Edge web |
Image & Text Automation (Fallback)
When selectors are unreliable (Citrix, remote desktop, legacy apps):
- Find Image + Click Image — click based on a screenshot template.
- Computer Vision activities — AI-powered element detection.
Web Automation Example
Use Application/Browser: https://example.com
Type Into [Username field]: "myuser"
Type Into [Password field]: "mypass"
Click [Login button]
Get Text [Welcome message] → welcomeMsg
Log Message: welcomeMsg
6. Excel & Data Table Automation
Excel Activities (requires Excel to be installed)
| Activity | Purpose |
|---|---|
Use Excel File | Open/create an Excel file (modern, recommended) |
Read Range | Read cells into a DataTable |
Write Range | Write a DataTable to a sheet |
Append Range | Add rows below existing data |
Read Cell | Read a single cell value |
Write Cell | Write to a single cell |
For Each Excel Row | Iterate rows one-by-one (modern) |
Filter Data Table | Filter rows by condition |
Sort Data Table | Sort rows |
DataTable Operations
' Create DataTable
Assign: dt = New DataTable
' Add columns
Invoke Code: dt.Columns.Add("Name", GetType(String))
dt.Columns.Add("Age", GetType(Integer))
' Add row
Invoke Code: dt.Rows.Add("Alice", 30)
' Get cell value
Assign: name = dt.Rows(0)("Name").ToString
' Row count
Assign: count = dt.Rows.Count
' Filter (LINQ)
Assign: filtered = (From row In dt.AsEnumerable()
Where row.Field(Of String)("Status") = "Pending"
Select row).CopyToDataTable()
Excel Automation Workflow Pattern
Use Excel File: "Input.xlsx"
Read Range [Sheet1] → inputDT
For Each Row In inputDT
' Process each row
Assign: name = CurrentRow("Name").ToString
Assign: email = CurrentRow("Email").ToString
' ... do work ...
Assign: CurrentRow("Status") = "Done"
Write Range → "Output.xlsx" [Sheet1]
7. String Manipulation & Regex
Common String Methods
str.ToUpper() ' "hello" → "HELLO"
str.ToLower() ' "HELLO" → "hello"
str.Trim() ' Remove whitespace from both ends
str.TrimStart() / str.TrimEnd()
str.Replace("old", "new")
str.Contains("search") ' Returns Boolean
str.StartsWith("pre")
str.EndsWith("suf")
str.IndexOf("x") ' Position of first occurrence
str.Substring(start, length) ' Extract portion
str.Split(","c) ' Split into array by delimiter
str.Length ' Character count
String.Join(",", array) ' Join array into string
String Formatting
' Concatenation
result = "Hello, " + name + "!"
' String interpolation (VB.NET)
result = $"Hello, {name}! You are {age} years old."
' Format
result = String.Format("Invoice #{0} — Total: ${1:F2}", invoiceId, total)
Regular Expressions
Used via the Matches, IsMatch, Replace activities or System.Text.RegularExpressions.Regex.
| Pattern | Matches |
|---|---|
\d+ | One or more digits |
\w+ | One or more word characters |
\s+ | One or more whitespace characters |
[A-Z]{2,3} | 2–3 uppercase letters |
^\d{5}$ | Exactly 5 digits (full string) |
(\d{3})-(\d{4}) | Phone pattern with capture groups |
' Extract all email addresses from text
Matches Activity:
Input: bigText
Pattern: "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}"
Result: emailMatches (IEnumerable(Of Match))
8. Error Handling & Logging
Try/Catch
Wrap risky operations in a Try Catch activity:
Try
[activities that might fail]
Catch (Exception e)
Log Message: "Error: " + e.Message (level: Error)
[recovery actions or rethrow]
Finally
[always runs — good for cleanup]
Common Exception Types
| Exception | When It Occurs |
|---|---|
SelectorNotFoundException | UI element not found |
ImageOperationException | Image not found on screen |
BusinessRuleException | Custom — data doesn't meet business rules |
ApplicationException | App crashed / unexpected behavior |
NullReferenceException | Variable is Nothing/null |
FormatException | Wrong data type conversion |
Retry Scope
Automatically retries a block on failure:
Retry Scope
NumberOfRetries: 3
RetryInterval: 00:00:05
Body: [activities to retry]
Condition: [success condition check]
Logging Best Practices
' Log levels (use appropriately)
Log Message: "Starting process" ' Info
Log Message: "Processing row: " + rowId ' Trace
Log Message: "Retrying login..." ' Warning
Log Message: "Fatal: " + ex.Message ' Error
' Always include context — who, what, which row
Log Message: $"[OrderBot] Processing order {orderId} for customer {custName}"
Global Exception Handler
In the Main.xaml, set Global Exception Handler to catch uncaught errors at the process level. Used in RE Framework's Main.xaml state machine.
9. PDF, Email & File Automation
File & Folder Operations
' File activities (System namespace)
Path Exists → check if file/folder exists
Copy File → copy a file to new location
Move File → move/rename
Delete → delete file or folder
Get Files → list files matching pattern ("*.xlsx")
Create Directory → make a folder
' Common paths in VB.NET expressions
Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
System.IO.Path.Combine(folderPath, fileName)
System.IO.Path.GetFileName(fullPath) ' "report.xlsx"
System.IO.Path.GetExtension(fullPath) ' ".xlsx"
System.IO.Path.GetFileNameWithoutExtension ' "report"
Email Automation
Outlook (via UiPath.Mail.Activities):
Get Outlook Mail Messages:
MailFolder: "Inbox"
Filter: "[Subject] = 'Invoice'"
Top: 50
→ emails (List(Of MailMessage))
For Each email In emails
Assign: subject = email.Subject
Assign: body = email.Body
For Each attach In email.Attachments
Save Attachment → folderPath
Send Email:
Send Outlook Mail Message:
To: "recipient@company.com"
Subject: "Automation Report"
Body: "Process completed. See attached."
Attachments: {"C:\report.xlsx"}
PDF Automation
' Read all text from a PDF
Read PDF Text:
FileName: "invoice.pdf"
→ pdfText (String)
' Then use String activities / Regex to extract fields
Matches: pdfText, "Invoice #(\d+)" → invoiceNum
Matches: pdfText, "Total: \$([0-9,.]+)" → totalAmt
10. Selectors & UI Explorer
What is a Selector?
A selector is an XML path that identifies a UI element. Example:
<wnd app='chrome.exe' title='Gmail - *' />
<webctrl tag='INPUT' name='Email' type='email' />
Dynamic Selectors
When selectors contain changing values (row numbers, IDs), use variables:
<!-- Static (breaks when row changes) -->
<webctrl idx='3' tag='TD' />
<!-- Dynamic (use variable) -->
<webctrl idx='{{rowIndex}}' tag='TD' />
In the activity, set the Selector property to a string expression:
"<webctrl idx='" + rowIndex.ToString + "' tag='TD' />"
UI Explorer
Open via Tools → UI Explorer. Use it to:
- Inspect element attributes.
- Build reliable selectors.
- Test if a selector matches exactly one element.
- Fix broken selectors after app updates.
Selector Best Practices
- Prefer
name,automationid,typeoveridx(index breaks easily). - Remove
titleattributes that include the document name (changes per file). - Use Anchor Base when no unique selector exists — anchor to a nearby stable element.
- For dynamic tables, use
Find Children+ loop instead of hardcoded selectors.
11. Orchestrator — Managing Bots at Scale
Key Orchestrator Concepts
Tenants & Folders — organize robots, processes, and assets by team or department.
Machines — the computers where robots run. Register a machine by installing UiPath Robot and connecting it to Orchestrator.
Processes — published packages deployed to Orchestrator. A package is a .nupkg file you publish from Studio.
Jobs — triggered executions of a process. Can be scheduled (triggers) or on-demand.
Queues — the backbone of unattended RE Framework automation.
Queues
A Queue is a list of Queue Items (transactions). Each item has:
- Specific Data — the payload (JSON/dictionary of fields like
OrderID,CustomerName). - Status — New → In Progress → Successful / Failed / Retried.
- Deadline / Postpone — optional time constraints.
- Reference — a unique identifier for the item.
Dispatcher process — adds items to the queue. Performer process — picks up items one-by-one and processes them.
Assets
Stored credentials and config values:
| Asset Type | Example |
|---|---|
| Text | Base URL: https://app.company.com |
| Integer | Max retries: 3 |
| Boolean | SendEmailReport: True |
| Credential | SAP username + password |
Access in workflow:
Get Asset: AssetName: "SAP_Credentials" → credential
Get Asset: AssetName: "BaseURL" → baseUrl
Publishing a Package
- In Studio: Design tab → Publish.
- Choose Orchestrator as target.
- Set version number.
- In Orchestrator: Packages → deploy to a process.
- Create a Trigger (time-based or queue-based) to schedule it.
12. Reusable Libraries & Packages
Why Reuse?
Instead of rebuilding the same login workflow in every project, extract it into a Library and reuse it across projects.
Creating a Library
- New Project → Library.
- Build workflows (each
.xamlbecomes a callable activity). - Publish to Orchestrator or a local NuGet feed.
- In other projects: Manage Packages → install your library.
- The library's workflows appear in the Activities panel.
Workflow Invoke Pattern
For smaller reuse within one project:
Invoke Workflow File: "Workflows\Login.xaml"
Arguments:
in_URL (In): baseUrl
in_Username (In): username
in_Password (In): password
out_IsLoggedIn (Out): isLoggedIn
13. RE Framework (Robotic Enterprise Framework)
This is the most important section for production-grade automation. The RE Framework is UiPath's official template for building robust, scalable unattended bots.
Why RE Framework?
Without a framework, most bots:
- Crash on unexpected errors and don't recover.
- Can't be monitored or restarted cleanly.
- Mix "get data" logic with "process data" logic.
- Have no retry mechanism.
RE Framework solves all of this.
Architecture — State Machine
RE Framework uses a State Machine with 4 states:
┌─────────────────┐
│ INITIALIZATION │ ← Start here (open apps, read config)
└────────┬────────┘
│ Success
┌────────▼────────┐
┌────►│ GET TRANSACTION │ ← Fetch next work item from Queue
│ └────────┬────────┘
│ │ Item found
│ ┌────────▼────────┐
│ │ PROCESS │ ← Do the actual work
│ │ TRANSACTION │
│ └────────┬────────┘
│ │
└──────────────┘ (loop back for next item)
│ No more items
┌────────▼────────┐
│ END PROCESS │ ← Close apps, send report
└─────────────────┘
File Structure
MyProcess/
├── Main.xaml ← State Machine (do not edit logic here)
├── project.json ← Project metadata
├── Data/
│ └── Config.xlsx ← All settings (URLs, queue names, etc.)
├── Framework/
│ ├── InitAllApplications.xaml ← Open all apps, login
│ ├── CloseAllApplications.xaml ← Close apps cleanly
│ ├── GetTransactionData.xaml ← Get next queue item / row
│ ├── SetTransactionStatus.xaml ← Mark item Success/Fail in Orchestrator
│ ├── InitAllSettings.xaml ← Read Config.xlsx + Orchestrator Assets
│ ├── TakeScreenshot.xaml ← Screenshot on error
│ └── RetryCurrentTransaction.xaml
└── Process.xaml ← YOUR BUSINESS LOGIC GOES HERE
Config.xlsx Structure
| Name | Value | Asset | Description |
|---|---|---|---|
| OrchestratorQueueName | OrdersQueue | Queue to read transactions from | |
| MaxRetryNumber | 3 | Retries per transaction | |
| logF_BusinessProcessName | OrderProcessor | Used in log messages | |
| in_TransactionNumber | 0 | Counter (do not change) |
Transaction Types
Queue-based (default): Items come from an Orchestrator Queue. Best for large volumes, parallel processing.
DataTable-based: Items come from an Excel file or database. Used when Orchestrator isn't available or for simpler use cases.
Exception Types in RE Framework
| Exception | Behavior |
|---|---|
BusinessRuleException | Item marked Failed (Business). Not retried. Example: invalid data. |
ApplicationException | Item marked Failed (Application) and retried up to MaxRetryNumber. Example: app timeout, element not found. |
' Throw a BusinessRuleException (your code in Process.xaml)
Throw New BusinessRuleException("Order ID is missing or invalid")
' ApplicationExceptions are caught automatically by the framework
' — just let them propagate up from Process.xaml
Process.xaml — Your Code Goes Here
This is the only file you heavily edit. It receives one transaction at a time:
Input Arguments:
in_TransactionItem (QueueItem or DataRow)
in_Config (Dictionary(Of String, String))
Steps in Process.xaml:
1. Extract fields from in_TransactionItem
2. Open the target application (or it's already open from Init)
3. Perform the business steps
4. If data is invalid → Throw BusinessRuleException
5. If app misbehaves → let ApplicationException propagate
RE Framework Execution Flow (Detailed)
INIT STATE
├── InitAllSettings.xaml → reads Config.xlsx, loads Orchestrator Assets
├── InitAllApplications.xaml → opens apps, logs in
└── On success → go to GET TRANSACTION STATE
GET TRANSACTION STATE
├── GetTransactionData.xaml
│ Queue mode: Get Queue Item from Orchestrator → transactionItem
│ Table mode: Get next unprocessed row
└── If item found → PROCESS TRANSACTION STATE
If no more items → END PROCESS STATE
PROCESS TRANSACTION STATE
├── Process.xaml (your business logic)
├── If BusinessRuleException:
│ Mark item as Failed (Business) — do NOT retry
├── If ApplicationException (1st–Nth time):
│ Take screenshot, log error
│ If retries < MaxRetryNumber → restart Init, retry same item
│ If retries exhausted → mark Failed (Application)
└── If success → SetTransactionStatus "Successful" → loop to GET TRANSACTION
END PROCESS STATE
├── CloseAllApplications.xaml
└── Send summary email (optional)
14. Advanced Topics
Parallel Processing
Parallel Activity — run multiple branches simultaneously:
Branch 1: Process Web App
Branch 2: Process Desktop App
Branch 3: Write to Excel
Note: branches share the same thread pool. Use for I/O-bound work,
not for UI automation (which requires focus on one window at a time).
Invoke Code Activity
Run VB.NET or C# code directly when no activity exists:
' VB.NET code in Invoke Code
Dim result As String = ""
For Each line As String In text.Split(Environment.NewLine)
If line.Contains("Total") Then
result = line.Split(":"c)(1).Trim()
Exit For
End If
Next
' Pass result back via argument
API & HTTP Automation
HTTP Request Activity:
EndPoint: "https://api.example.com/orders"
Method: GET
Headers: {"Authorization": "Bearer " + token}
→ response (String / JObject)
Deserialize JSON:
Input: response
→ jsonObj (JObject)
Assign: orderId = jsonObj("data")("id").ToString
Citrix / Virtual Desktop Automation
When the bot runs inside Citrix/VDI:
- Standard selectors don't work (you're seeing pixels, not DOM).
- Use Computer Vision activities (CV Click, CV Type, CV Get Text).
- Or use Image activities as a fallback.
- Best approach: ask the Citrix admin to enable accessibility on the hosted app.
Testing in UiPath
- Workflow Analyzer — static analysis; catches naming issues, missing error handling.
- Debug Mode — step through activities one-by-one; inspect variable values.
- Breakpoints — pause execution at a specific activity.
- Mock Testing — mock Orchestrator calls to test locally.
- UiPath Test Manager — dedicated test management for RPA QA.
Performance Tips
- Use
SimulateClick/SimulateTypewhere possible — no need for the window to be in focus. - Minimize
Wait for Ready— useNONEmode and add explicitElement Existschecks. - Batch write to Excel at the end rather than writing each row individually.
- For large DataTables, use LINQ instead of nested For Each loops.
- Close applications properly to free memory.
15. Best Practices & Certification Tips
Naming Conventions
| Element | Convention | Example |
|---|---|---|
| Workflow files | PascalCase | GetTransactionData.xaml |
| Variables | camelCase with prefix | strCustomerName, dtOrderData, intCounter |
| Arguments | direction prefix | in_Config, out_Result, io_DataTable |
| Activities | Descriptive label | "Type customer email into field", not "Type Into" |
General Best Practices
- One workflow = one responsibility. Keep workflows focused and short (< 50 activities visible on screen).
- Log at every significant step. Use Business, Warning, and Error levels appropriately.
- Never hardcode credentials. Always use Orchestrator Assets or Windows Credential Manager.
- Never hardcode URLs or file paths. Store in Config.xlsx or Orchestrator Assets.
- Always handle both ApplicationException and BusinessRuleException in RE Framework.
- Use version control (Git). UiPath Studio integrates with Git natively.
- Run the Workflow Analyzer before publishing. Aim for 0 errors, 0 warnings.
- Take screenshots on error — invaluable for debugging production failures.
UiPath Certifications
| Cert | Level | Focus |
|---|---|---|
| UiRPA | Associate | Studio basics, automation fundamentals |
| UiARD | Professional | RE Framework, advanced automation, Orchestrator |
Study path: UiPath Academy → take free courses → practice on real projects → take exam.
Quick Reference Card
COMMON SHORTCUTS (UiPath Studio)
F5 Run workflow
F6 Debug (step through)
F7 Step Into
F8 Step Over
Ctrl+D Disable activity
Ctrl+E Enable activity
Ctrl+K Create variable from selected property
Ctrl+M Create argument from selected property
Ctrl+L Open output log
ACTIVITY CHEAT SHEET
Input/Output: Read Range, Write Range, Read Cell, Write Cell
UI: Click, Type Into, Get Text, Send Hotkey, Check
Logic: If, Switch, While, For Each, Try Catch, Retry Scope
Data: Filter Data Table, Sort Data Table, Build Data Table
File: Copy File, Move File, Delete, Get Files
String: Assign (with .Replace, .Split, .Substring, etc.)
Orchestrator: Add Queue Item, Get Transaction Item, Set Transaction Status, Get Asset
Guide complete. Move to the RE Framework project for hands-on practice.
No comments:
Post a Comment