46 Selectors & Ui Automation Part 2 (UI Explorer)

preview_player
Показать описание
#uipathcommunity #uipathdeveloper #uipathtutorial
What are selectors?
Selectors is the feature of the UiPath, which enable identification,
Of the Graphical User Interface (GUI).
Why we use selectors?
To identify the gui elements to perform events or specific actions on applications as per the business process or our requirement. Selectors are plays crucial roles in UI automation.
Tags :-
• Nodes in the selector XML fragment
• Correspond to a visual element on the screen
• First node is the app window
• Last node is the element itself
For example:
• wnd (window)
• html (web page)
• ctrl (control)
• webctrl (web page control)
• java (Java application control)
Every attribute has a name and a value. You should use only attributes with constant or known values.
For example:
• parentid=‘slide-list-container’
• tag=‘A’
• aaname=‘Details’
• class=‘btn-dwnl’
Supported Tags and Attributes
UI Explore :-
UI Explorer is an advanced tool that enables you to create a custom selector for a specific UI
element. It is available only if the UiPath.UIAutomation.Activities package is installed as a
dependency to the project.
To open the UI Explorer window, click the button in the Selectors section, in the Design tab.
UI Explore helps us for fine tuning of selectors.
Types of Selectors :
Full Selectors : It records all elements from top element to require elements to perform the require action. This selectors are generate by basic recorder.
Partial Selectors : It records top main element and require element to perform the specific action.
This selectors are generate by desktop recorder. Partial recorders are fast when compare to full selectors.
As previously presented, selectors are automatically generated when UI elements are indicated inside activities or when the recorder is used. Knowing the difference between full and partial selectors is very important when using activities generated or added inside containers outside the containers, or the other way around.
The containers in UiPath are Attach Window, Attach Browser and Open Browser.
Full Vs Partial Selector:
Generated by Basic Selector Generated by Desktop Selector
Contains all the elements needed to identify a UI element, including top level window Do not contain information about the top-level window
Recommended when switching between multiple windows Recommended when performing multiple actions in the same window
Every activity contains full selector Activities containing partial selectors are enclosed in a container(Attach Browser or Attach Window) that contains a full selector of the top-level window
Cannot edit the top-level window in the activities inside the container, must edit at the top-level container
When are partial or full selectors used?
The best example of using a Partial Selector would be a simple automation where the deployed workflow only performs actions in the same application without shifting through multiple windows like a simple CRM.
On the other hand if the workflow would actually be required to interact with multiple windows like the same CRM and a document, which would make the UI elements required in this particular example dispersed in multiple windows, a Full Selector would be required.
Dynamic selectors :
By applying wild cards we can make dynamic the selectors.
Wild Cards:
Asterisk (*) – replaces zero or more characters
Question mark (?) – replaces a single character
What is fine-tuning?
Fine-tuning is the process of refining selectors in order to have the workflow correctly executed in situations in which the generated selector is unreliable, too specific or too sensitive with regards to system changes.
It mainly consists of small simple changes that have a larger impact on the overall process, such as adding wildcards, using the repair function or using variables in selectors.
What are some business scenarios in which fine-tuning is required?
The workflow uses files that have timestamp in the name;
The environment in which a workflow was built has different parameters than the production environment (for example, the application version);
The use of dynamic selectors would improve the reliability and robustness of the automation.
Passing Variable in Selectors:
Events:
Click
Type into
Double Click
Hover
Type Into
Type Secure Text
Select Item
Рекомендации по теме