Study guide
7.3 Dynamic Selectors, Variables & Wildcards in Selectors
UiPath Automation Developer Professional UiPath-ADPv1
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Exam Overview & Blueprint Map
1.1 About the UiPath-ADPv1 Exam: Format, Fees & Policies 1.2 The Exam Topics Mapped to This Guide & a Study Plan
2 Chapter 2: REFramework Architecture & State Dynamics
2.1 State Machine Architecture & The Four Core States 2.2 Configuration Management: Settings, Constants, and Assets 2.3 Transaction Types & The Dispatcher vs. Performer Architecture 2.4 Adapting REFramework: Tabular Data, Collections & Linear Processes
3 Chapter 3: REFramework Exception Handling & Recovery
3.1 BusinessRuleException vs. System.Exception Handling Patterns 3.2 Retry Mechanisms: Queue Retries vs. REFramework MaxRetryNumber 3.3 Consecutive System Exceptions & Graceful Process Termination
4 Chapter 4: State Machines, Custom Log Fields & REFramework Testing
4.1 Building State Machine Projects in Studio 4.2 Logging Levels, Robot Logs & Custom Log Fields in REFramework 4.3 Testing a REFramework Project With and Without Orchestrator Queues
5 Chapter 5: LINQ Queries & DataTable Operations
5.1 LINQ Essentials for Collections & Filtering 5.2 Advanced DataTable Querying with LINQ 5.3 In-Memory DataTable Transformations & Column Operations
6 Chapter 6: Regex, DateTime, JSON & Invoke Activities
6.1 Regular Expressions & Text Parsing for Automation 6.2 DateTime Formatting, Timezone Conversions & TimeSpan Calculations 6.3 JSON Parsing, JSONPath & Serialization with Newtonsoft.Json 6.4 Invoke Method & Invoke Code Activities 6.5 Data Referencing in Invokes: DataTable, List & Dictionary Arguments
7 Chapter 7: Modern UI Automation & Unified Targeting
7.1 Modern Design Experience & The Unified Target Concept 7.2 Anchors, Relative Elements & UI Automation Activities 7.3 Dynamic Selectors, Variables & Wildcards in Selectors
8 Chapter 8: Object Repository, Computer Vision & Remote Runtime
8.1 Object Repository & UI Descriptor Libraries 8.2 AI Computer Vision for Unattended & Remote Interfaces 8.3 Automation in Virtual Environments & UiPath Remote Runtime
9 Chapter 9: Advanced UI Automation: Browser Modes, Agentic UI & macOS
9.1 Browser Automation with the WebDriver Protocol 9.2 Agentic UI Automation: ScreenPlay, Semantic Activities & Healing Agent 9.3 macOS Automation: Native Apps, Office Apps & AppleScript
10 Chapter 10: Advanced Control Flow & Exception Architecture
10.1 Flowcharts, Sequences & Parallel Control Flow Patterns 10.2 Global Exception Handler Architecture & ErrorAction Directives 10.3 TryCatch, Retry Scope & Custom Exception Architectures
11 Chapter 11: Orchestrator Queues & Transaction Management
11.1 Queue Architecture, SpecificContent & Transaction Lifecycles 11.2 Queue Items SLA, Postpone, Deadlines & Priority Scheduling 11.3 Bulk Operations, Transaction Status Updates & Queue Triggers
12 Chapter 12: Orchestrator Tenant & Folder Entities
12.1 Asset Types, Per-Robot Assets & External Credential Stores 12.2 Modern Folder Hierarchy, User/Robot Assignment & Permissions 12.3 Storage Buckets, Webhooks & Environment Promotion 12.4 Orchestrator Tags: Labels, Properties & Governance
13 Chapter 13: Unattended Execution, API Triggers & Cloud Robots
13.1 Unattended Job Execution: Folders, Priorities, Background vs. Foreground & Runtimes 13.2 API Triggers: Starting Jobs from External Systems over HTTP 13.3 Serverless and Cloud VM Robots: Cloud-Hosted Execution Options
14 Chapter 14: Monitoring, Recording & Solutions Management
14.1 Orchestrator Monitoring, Trigger Alerts & Job Health 14.2 Job and Transaction Recording: Troubleshooting Faulted Unattended Jobs 14.3 Solutions Management: Packaging and Deploying Automations with Their Resources
15 Chapter 15: Debugging, Remote Debugging & Profiling
15.1 Studio Debugging Tools: Breakpoints, Panels & Execution Control 15.2 Remote Debugging: Remote Machine and Unattended Robot Connections 15.3 Profile Execution: Finding Performance Bottlenecks in Studio
16 Chapter 16: RPA Testing & Test Suite
16.1 UiPath Test Suite Overview, Test Cases & Given-When-Then Structure 16.2 Data-Driven Testing, Test Verification Activities & Mock Activities 16.3 CI/CD Pipelines with uipcli & Test Manager Traceability
17 Chapter 17: Long-Running Workflows, Action Center & Apps
17.1 Long-Running Workflows: Persistence, Suspend and Resume 17.2 Action Center & Human-in-the-Loop Orchestration 17.3 UiPath Apps: Action Apps, Automations & Integration Service
18 Chapter 18: Trigger-Based Attended Automation & Callouts
18.1 Trigger-Based Attended Automation: Forms, Triggers & Global Variables 18.2 Running Local Triggers & the Event Inspection Tool 18.3 Callouts & Forms for Attended Guidance
19 Chapter 19: UiPath Assistant & Robot Sessions
19.1 UiPath Assistant: Automations, Reminders, Widgets & Configuration 19.2 Robot Session (Picture in Picture): Child Session vs. Virtual Desktop
20 Chapter 20: Autopilot for Developers & Autopilot for Everyone
20.1 Autopilot for Developers: AI Assistance in Studio and Studio Web 20.2 Autopilot for Everyone: Chat, Automations & Clipboard AI
21 Chapter 21: API Automation & Integration Service
21.1 Integration Service: Connectors, Connections & Connector Activities 21.2 API Workflows in Studio Web 21.3 HTTP Requests: Web APIs, the Orchestrator API & Connector Requests 21.4 Connector Builder: Custom Integration Service Connectors 21.5 Integration Service Event Triggers: Connected and Disconnected 21.6 GenAI Activities: Generative AI Inside Workflows
22 Chapter 22: Data Service, Context Grounding & Coded Workflows
22.1 Data Fabric (Data Service) Entities: Modeling Business Data 22.2 Data Fabric Activities and the Platform Connector 22.3 Context Grounding: Retrieval-Augmented Generation with Company Data 22.4 Coded Automations: Structure, Arguments & Invoking Workflows 22.5 Coded Automation Services: Orchestrator, UI Automation, Microsoft 365 & Custom Services
23 Chapter 23: Integrated Scenario Practice
23.1 Integrated Scenario Practice: Designing an End-to-End Solution
7.3 Dynamic Selectors, Variables & Wildcards in Selectors
Key Takeaways Explain This Topic AI
UiPath selectors are hierarchical XML fragments where Full Selectors contain top-level window/HTML tags and Partial Selectors omit root nodes, relying on container scopes to provide window handles.
UI Explorer provides essential diagnostic capabilities through its Visual Tree, Property Explorer, Selector Editor, and real-time validation and repair utilities.
Wildcard characters—asterisk ( * ) for zero or more characters and question mark ( ? ) for exactly one character—enable selectors to tolerate volatile titles, dynamic session IDs, and timestamp mutations.
Modern dynamic selectors bind runtime variables directly within XML attribute values using double curly-brace syntax ( {{variableName}} ), eliminating error-prone string concatenation.
Advanced selector stabilization utilizes regular expression matching ( matching:attribute='regex' ) and case-insensitivity directives ( casesensitive:attribute='false' ) to handle complex dynamic patterns.
Last updated: September 2026
7.3 Dynamic Selectors, Variables & Wildcards in Selectors
Core Concept: At the foundational layer of both Modern and Classic UI Automation sits the XML Selector . A selector is an XML fragment that uniquely identifies a graphical user interface control by cataloging its hierarchical structural attributes within the operating system or browser Document Object Model (DOM). In real-world enterprise automations, static selectors frequently break because target applications generate dynamic session IDs, timestamped window titles, and data-dependent button names. Mastering dynamic selectors , wildcards , and advanced attribute matching is critical for engineering stable, production-grade automations.
When a selector fails, unattended robots stop, transactions fault, and business operations stall. By replacing volatile values with wildcards, injecting runtime variables via modern double curly-brace syntax ( {{variableName}} ), and leveraging regular expressions ( matching:aaname='regex' ), developers transform rigid, brittle selectors into resilient, adaptable targeting engines.
1. Selector Syntax and XML Node Architecture
A UiPath selector is composed of one or more hierarchical XML nodes, ordered from the top-level application window down to the specific leaf element: <wnd app='excel.exe' cls='XLMAIN' title='Quarterly_Report_2026.xlsx - Excel' />
- <uia cls='NetUIHWND' name='Ribbon' />
- <uia cls='NetUIRibbonButton' name='Save' />
Each line in the selector represents a Selector Node , enclosed in angle brackets ( < ... /> ). A node consists of a Tag and one or more Attributes :
Tag: Identifies the technical layer or element type (e.g., <wnd> for a Win32 window, <html> for a browser page, <webctrl> for an HTML DOM element, <ctrl> for Active Accessibility, or <uia> for UI Automation nodes).
Attribute Name: The property being inspected (e.g., app , title , cls , id , name , aaname , tag ).
Attribute Value: The expected value required for a match, enclosed in single quotes (e.g., tag='BUTTON' ).
Common Selector Tags and Attributes
Tag / Attribute Target Technology Purpose & Diagnostic Value
<wnd> Desktop Win32 / WPF Represents an operating system window. Common attributes: app (executable name, e.g., notepad.exe ), cls (window class name, e.g., Notepad ), title (window title bar text).
<html> Web Browser Represents an active web browser tab. Common attributes: app (e.g., chrome.exe , msedge.exe ), title (HTML <title> tag), url (web page address).
<webctrl> Web DOM Element Represents an HTML element inside a browser. Common attributes: tag ( INPUT , BUTTON , DIV , TABLE ), id , name , aaname (Active Accessibility name / visible label), class .
<ctrl> Win32 / MSAA Microsoft Active Accessibility node. Common attributes: role ( push button , editable text , menu item ), name .
aaname Multi-technology "Active Accessibility Name". Represents the human-readable text label of an element. Highly valuable for buttons, links, and headers.
idx Multi-technology Ordinal numerical index (e.g., idx='3' ). Warning: Represents the element's position among identical siblings. Highly volatile and discouraged in production automations.
2. Full Selectors vs. Partial Selectors
Understanding the distinction between Full Selectors and Partial Selectors is fundamental to designing maintainable workflows: +-----------------------------------------------------------------------------------+
- | FULL SELECTOR (Standalone Execution) |
- | |
- | <html app='chrome.exe' title='ACME System 1 - Dashboard' /> <-- Root Window |
- | <webctrl tag='BUTTON' id='btn_logout' aaname='Log Out' /> <-- Leaf Target |
- | |
- | - Contains the top-level window/browser node. |
- | - Can execute independently outside any container. |
- +-----------------------------------------------------------------------------------+
- +-----------------------------------------------------------------------------------+
- | PARTIAL SELECTOR (Container-Bound Execution) |
- | |
- | Container: Use Application/Browser Scope |
- | Container Selector: <html app='chrome.exe' title='ACME System 1 - Dashboard' /> |
- | │ |
- | └── Activity: Click |
- | Partial Selector: <webctrl tag='BUTTON' id='btn_logout' aaname='Log Out' /> |
- | |
- | - Omits root window node; inherits window handle (HWND) directly from container. |
- | - Faster execution, centralized window title management. |
- +-----------------------------------------------------------------------------------+
- Architectural Comparison
Evaluation Metric Full Selector Partial Selector
Root Node Presence Contains top-level <wnd> or <html> node. Omits top-level window tags; starts directly at child/element level.
Container Requirement Can execute standalone; does not require an enclosing container activity. Must reside inside a container activity ( Use Application/Browser , Attach Window , Attach Browser ).
Execution Performance Slower: Must search the entire desktop OS visual tree to locate the window on every action. Faster: Container caches the application's window handle ( HWND ); child activities query within that window handle directly.
Maintenance Overhead High: If an application window title changes, every single activity selector must be updated. Low: Update the window selector once on the parent container; all nested partial selectors inherit the update.
Multi-Window Handling Can jump between completely different applications in sequential activities without containers. Bound to the application context defined by the enclosing scope.
3. Tuning Selectors in UI Explorer
UI Explorer is UiPath's advanced diagnostic and tuning utility for inspecting the application hierarchy and constructing robust selectors. +---------------------------------------------------------------------------------------+
- | UI EXPLORER |
- | |
- | [VISUAL TREE PANEL] [SELECTOR EDITOR PANEL] |
- | ├── wnd app='chrome.exe' <html app='chrome.exe' title='Invoicing' /> |
- | │ └── ctrl name='Document' <webctrl tag='INPUT' id='inv_num' /> |
- | │ ├── webctrl tag='FORM' |
- | │ └── webctrl tag='INPUT' [VALIDATE BUTTON] -> [State: Green (Valid)] |
- | |
- | [PROPERTY EXPLORER PANEL] [SELECTED ATTRIBUTES PANEL] |
- | aaname = "Invoice Number" [*] tag = 'INPUT' |
- | id = "inv_3948293" [ ] id = 'inv_3948293' <-- Dynamic! Deselect |
- | class = "form-control input" [*] aaname = 'Invoice Number' <-- Stable! Select |
- | visibleinnertext = "" [*] name = 'invoiceNumber' |
- +---------------------------------------------------------------------------------------+
Key Panels and Operational Utilities in UI Explorer:
Visual Tree (Left Panel): Displays the entire hierarchical object model of the desktop or DOM. Developers can navigate up to parent containers or drill down into child nodes, identifying parent wrappers that offer more stable structural attributes.
Property Explorer (Lower-Left Panel): Catalogs every single UI property exposed by the selected control (including accessibility properties, DOM attributes, bounding coordinates, and visibility flags). This allows developers to discover hidden, stable identifiers that Studio did not select automatically.
Selector Editor (Top-Right Panel): The working area where the active selector is constructed. Attributes can be edited directly, wildcards inserted, or variable bindings defined.
Validation States:
Green Checkmark (Valid): The selector successfully and uniquely identifies exactly one active UI element on screen.
Red Cross (Invalid): The selector cannot find any matching element on the active desktop.
Yellow Warning (Changed): The selector was manually edited and requires revalidation by clicking the Validate button.
Indicate Element & Repair:
Indicate Element: Allows re-pointing to a different UI control.
Repair: If a target application layout changes and breaks a selector, clicking Repair prompts the developer to click the element on screen again. UiPath compares the old selector with the new element's attributes and automatically updates attributes with wildcards or new stable tags.
Highlight: Flashes a high-visibility colored bounding box around the element identified by the selector, allowing visual confirmation that the selector matches the intended target rather than a hidden sibling.
4. Wildcards in Selectors
When applications incorporate dynamic elements—such as window titles containing changing document names, web pages with session IDs, or timestamps—static selectors fail. UiPath provides two essential wildcard operators to handle dynamic character sequences:
1. The Asterisk ( * ) Wildcard
Definition: Matches zero or more arbitrary characters.
Example 1 (Window Title): An application window displays the current document name: title='Monthly_Report_January_2026.xlsx - Excel' . In February, this becomes Monthly_Report_February_2026.xlsx . Replacing the dynamic month with an asterisk stabilizes the selector: <wnd app='excel.exe' cls='XLMAIN' title='Monthly_Report_*_2026.xlsx - Excel' />
Example 2 (Dynamic Web URL / Session ID): A web portal generates unique session IDs in its element IDs ( id='submit_btn_session_94820384' ): <webctrl tag='BUTTON' id='submit_btn_session_*' aaname='Submit' />
2. The Question Mark ( ? ) Wildcard
Definition: Matches exactly one arbitrary character.
Example (Fixed-Length Version or Page Code): An enterprise dashboard uses single-digit page indicators or fixed-format document codes (e.g., Doc_V1 , Doc_V2 ): <webctrl tag='DIV' aaname='Doc_V?' /> This matches Doc_V1 and Doc_V2 , but will not match Doc_V10 (which contains two characters following V ).
Caution
Avoid Overusing Wildcards: Replacing too many attributes with asterisks (such as <webctrl tag='*' aaname='*Submit*' /> ) causes selector ambiguity. If multiple elements match the wildcard pattern, the robot will either interact with the wrong element or throw an ambiguity exception. Always preserve static tags ( tag='BUTTON' ) and container anchors.
5. Dynamic Selectors Using Variables and Arguments
In transactional processes, robots must frequently interact with specific UI elements determined at runtime—such as clicking a table row corresponding to in_TransactionItem.SpecificContent("InvoiceID").ToString or selecting an account from a dropdown list.
In Modern UiPath Studio, developers parameterize selectors using double curly-brace syntax : {{variableName}} or {{argumentName}} . <!-- Targeting a dynamic customer row in an enterprise CRM table -->
- <webctrl tag='TABLE' id='customers_grid' />
- <webctrl tag='TD' aaname='{{in_CustomerName}}' />
Step-by-Step Parameterization in Studio:
Open the activity's Target selector in the Selector Editor .
Highlight the attribute value to parameterize (e.g., aaname='John Doe' ).
Right-click the highlighted text and choose Create Variable (or select an existing variable/argument from the context menu).
Studio automatically formats the attribute as aaname='{{in_CustomerName}}' .
At runtime, the robot dynamically evaluates the variable's current value in memory and injects it into the XML selector before querying the application tree.
Modern Variable Binding vs. Classic String Concatenation
In legacy Studio projects, dynamic selectors required cumbersome, unreadable VB string concatenation directly in the Properties panel: ' Legacy Classic Concatenation (Fragile and Error-Prone):
"<webctrl tag='BUTTON' aaname='" + in_CustomerName + "' />"
Modern double curly-brace syntax ( aaname='{{in_CustomerName}}' ) is directly supported inside the visual Selector Editor, supports syntax validation, and prevents syntax errors caused by missing quotes or concatenation operators.
6. Advanced Selector Matching: Regular Expressions & Case Sensitivity
For complex dynamic patterns that exceed simple wildcards, UiPath supports advanced selector matching directives.
1. Regular Expression Matching ( matching:attribute='regex' )
To match attributes adhering to complex alphanumeric patterns—such as formatted invoice numbers, UUIDs, or email addresses—developers activate regex matching by prepending matching:attributeName='regex' to the selector node: <!-- Matching an invoice label with pattern: INV- followed by exactly 6 digits -->
<webctrl tag='SPAN' matching:aaname='regex' aaname='^INV-\d{6}$' />
Practical Regex Selector Examples:
Alphanumeric Purchase Order Code: <webctrl tag='INPUT' matching:id='regex' id='^po_(alpha|beta)_[0-9]{4}$' />
Dynamic Subdomain or URL Routing: <html app='chrome.exe' matching:url='regex' url='https://(dev|uat|prod)\.acme\.com/dashboard' />
2. Case Sensitivity Directives ( casesensitive:attribute='false' )
By default, selector attribute matching in web and desktop applications is case-sensitive. If an application's backend randomly renders aaname='SUBMIT' in uppercase on some screens and aaname='Submit' in title case on others, a strict selector fails.
Developers override this behavior using the casesensitive directive: <!-- Case-insensitive matching for a submit button -->
<webctrl tag='BUTTON' casesensitive:aaname='false' aaname='submit' />
This matches Submit , SUBMIT , submit , or sUbMiT seamlessly.
7. Common Selector Pitfalls and Enterprise Best Practices
The idx Anti-Pattern:
Pitfall: Using idx (e.g., <webctrl tag='INPUT' idx='4' /> ). An idx attribute simply indicates that this is the 4th input tag found in the tree. If the web page displays an alert banner or adds a single field above, idx='4' silently shifts to a completely different field, causing the robot to enter data into the wrong control.
Remedy: Eliminate idx by adding stable attributes ( aaname , name , automationId ) or binding the target to an Anchor .
Dynamic Framework Hashes and GUIDs:
Pitfall: Relying on autogenerated IDs produced by modern web frameworks like React, Angular, or Blazor (e.g., id='btn_j_id_jsp_4920492' or class='button-primary ng-tns-c45-12' ). These tokens change every time the application is rebuilt or the user refreshes the page.
Remedy: In UI Explorer, uncheck volatile id and class attributes. Replace them with stable semantic attributes like tag='BUTTON' and aaname='Save' , or use wildcards ( id='btn_*' ).
Fragile Window Titles:
Pitfall: Recording window titles that include dynamic file paths, document names, or timestamps without wildcards (e.g., title='Report_2026-09-29_1400.pdf - Adobe Acrobat' ).
Remedy: Wildcard the dynamic suffix: title='Report_* - Adobe Acrobat' .
Prefer Partial Selectors within Containers:
Best Practice: Always nest UI interactions inside Use Application/Browser containers using Partial Selectors. This isolates top-level window changes to a single container activity and maximizes runtime execution speed.