UiPath-ADPv1 Advanced UI Automation Practice Question
You are automating a web application that uses dynamically generated IDs for its input fields. The IDs change every time the page loads, causing selectors with the 'id' attribute to fail. Which selector strategy should you use to create stable selectors for these fields?
⚠ Common exam trap
The trap here is assuming that a wildcard on the dynamic ID will always work, when in fact the entire ID may change and wildcards can introduce ambiguity.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use the 'aaname' attribute or the 'name' attribute if it is stable, combined with the 'class' attribute and the element's position in the DOM.
When element IDs are dynamically generated, selectors should rely on other stable attributes such as 'aaname', 'name', or 'class', often combined with a relative position in the DOM. This creates a selector that remains valid across page loads. Wildcards, pure CSS positional selectors, and tag-only selectors are either too fragile or too generic to be reliable in this scenario.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use the 'id' attribute with a wildcard, such as id='input_*', to match the dynamic portion of the ID.
Why it's wrong here
Wildcards can help when only part of the ID is dynamic, but if the entire ID is generated randomly, a wildcard like 'input_*' may not match if the prefix also changes. Moreover, wildcards increase the chance of matching multiple elements, leading to ambiguous selectors. This approach is fragile and not recommended when the ID is fully dynamic.
- ✓
Use the 'aaname' attribute or the 'name' attribute if it is stable, combined with the 'class' attribute and the element's position in the DOM.
Why this is correct
When IDs are dynamic, stable attributes such as 'aaname' (accessible name) or 'name' are better anchors. Combining them with 'class' and a relative position in the DOM (e.g., using the 'idx' attribute) creates a robust selector that does not depend on the volatile ID. UiPath's selector editor allows adding these attributes and validating the selector against multiple page loads.
- ✗
Use the 'css-selector' attribute with a selector that targets the element by its nth-child position in the DOM.
Why it's wrong here
While CSS selectors can target elements by position, they are highly brittle because any change in the DOM structure, such as adding or removing a sibling element, will shift the nth-child index and break the selector. This approach does not leverage stable attributes and is not recommended for dynamic web applications where the layout may change.
- ✗
Use the 'tag' attribute alone, such as tag='INPUT', because it will match all input fields and UiPath will automatically pick the correct one.
Why it's wrong here
Using only the tag attribute is far too generic; it will match every input field on the page, and UiPath cannot automatically determine which one is intended. This leads to ambiguous selectors that either fail or interact with the wrong element. A stable selector must include additional unique attributes or a combination of attributes to uniquely identify the target.
About these practice questions
One of 276 original UiPath-ADPv1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official UiPath exam blueprint
This UiPath-ADPv1 practice question is part of Courseiva's free UiPath certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the UiPath-ADPv1 exam.