Automation.Getter
Description
The Get All UI Elements Activity retrieves all UIElements that fit your selector and saves them into an array of UIElements. It is commonly used if you want to interact with one or more elements of the same type in an application or browser.
PropertiesAnalyst
- Description: Optional text for documentation purposes.
Common
-
Continue On Error: Continues the execution of the workflow even if an error occurs during the execution of the activity.
-
Delay Before: Delay time in milliseconds before the activity is executed. The default value is 250 milliseconds.
-
Delay After: Delay time in milliseconds after executing of the activity. The default value is 250 milliseconds.
-
Disable Log: Disables the logging functionality for this activity.
-
Disable Protocol: Disables the protocol functionality for this activity.
-
Exclude from Global Delay: Excludes this activity from the Global Delay functionality.
-
Timeout: Duration in milliseconds in which the activity tries to execute.
Element
- Automation Provider: The automation provider is usually automatically selected by the Smart Indicator depending on the application or browser you are automating. You can, however, change the automation provider manually while indicating (by pressing Shift + Up/Down)
- ArtefactID: If you have saved the selector value in an artifact, you can reference it here. If the value is 0, it is not connected to any artifact in the database.
- Element: In case you already retrieved the UIElement in the process, you can simply insert it in this field.
- Selector Value: This is the field where the Smart Indicator will store your indication result. You can, of course, also adjust the selector value manually.
- Show Debug Borders: If true, a bounding rectangle is drawn around the element identified as the target.
Output
- Elements: The activity will return an array of UIElements (UIElements[]) if at least one element with your specific selector value was found. Otherwise, you will get an ElementNotFoundException.
Suppose you want to print the titles of the article links under the headline Release History on our Helpdesk site in a new tab. If we further assume that the order of links will change in the future (Hyland RPA 2025.1 etc.), it makes sense to select all menu items shown under the sub menu Release History.
After dragging and dropping the Get All UI Elements Activity in your workflow, you can use the Indicate with Result option to select one link (Target, selector value: <a class ='sidenav__article-name' / >) and add the parent element for the section "Release History" (selector value: <li class ='sidenav__section ' data-sidenav-section-id ='360000367717' / > ), so that not all the article links on the website get stored in your array of UI Elements. With a click on Save your selection is saved.
For more information on the Indicate with Result, see the section on expert indicator within the Hyland RPA Designer documentation.
The correct variable type for your output (UIElement[]) is automatically generated for you if you create a variable using the pop-up dialog that opened after dropping the activity into the workflow.
The rest of the example can be found on the chapter covering the For each UI Element activity.
Tips and Tricks
- Sometimes it is helpful to use the developer tools of your browser (F12) as well. You can hover over the HTML element(s) and the corresponding element(s) will be highlighted on the web page.
- The Get All UI Elements will throw an exception if no element with the provided selector value can be found. You can either check the Continue On Error check box in the properties pane or wrap a try-catch-block around your activity to catch the ElementNotFoundException. The latter is especially useful if you want to differentiate between different exception types or perform a different action if no element could be retrieved.
Troubleshooting
- Core.Activities.Exceptions.ElementNotFoundException: Failed to find Element by the Selector '<[Your Selector Values] />' using the AutomationProvider 'Selenium 2.0' within '25000' ms.The activity was unable to find the element you are looking for. If the workflow should continue even if no element was found, you can check the Continue On Error property.
See also