Lesson 4 - Selectors
Lesson 4 - Selectors
Development
v4.0
Lesson 4 Selectors
Agenda
1 Describe UI Interactions
3 Describe Containers
UI interactions are the actions performed by a user to interact with the system at the user interface level.
UI
Click, Type Into, and Send Hotkey are all simple actions users perform while working with UI elements.
Used to perform input actions. There are three input methods available in Studio:
Working
• Attended User cannot touch the Supports special keys like Enter, Tab, • Does not automatically erase
mouse or keyboard during the and other hotkeys previously written text
automation • Does not work in the background
• It has a lower speed and load times
can impact accuracy
2. SendWindowMessages
Working
• Works in the background • Supports special keys like Enter, • Does not automatically erase
• Comparable to the Default method Tab, and other hotkeys previously written text
in terms of speed • Users can work on other activities • Works only with applications that
during the execution of the respond to Window Messages
automated processes
3. Simulate Type/Click
Working
• Works in the background • Can automatically erase previously • Does not support special keys like
• Actions are a lot faster, but there are written text Enter, Tab, and other hotkeys
some compatibility limitations • Users can work on other activities • It has lower compatibility than the
during the execution of the other 2 methods
automated processes
Classroom Exercise
A box that holds the activities that are being performed on the same application.
A container:
01 02 03 04 05
The recording functionality of Studio helps in capturing user‟s actions on the screen and translating them
into sequences.
Studio consists of six recorders that come with their own controllers to perform recording.
Basic Recording
Generates a full selector for each activity and no
container
Desktop Recording
Suitable for all types of desktop apps and multiple
actions
Web Recording
Used for recording in web apps and browsers
Basic Recording vs. Desktop
Recording
Image Recording
Used to record in virtualized environments such as
VNC, virtual machines, and Citrix for image, text &
keyboard automation
These actions enable the users to open an app or browser, as well as close them, by indicating and
selecting them. Start App is available in Basic & Desktop recorders and Open Browser is available in Web
recorder.
It enables the user to record clicks on the desktop. It is available in Basic, Desktop, Web, and Native Citrix
recorders.
It includes those actions that require input from the keyboard. It is available in all recorders.
It enables the user to copy a selected text from an opened application or a web browser. It is available in
Basic, Desktop, Web, and Native Citrix recorders.
It enables the user to perform actions on elements like looking for elements or waiting for them to vanish.
It is available in all recorders (except the Computer Vision recorder).
Control Element
Enables the user to
control a particular UI
element
Find Element
Enables the user to
identify specific UI
elements or pause the
automation
It enables the user to select or hover over text. It is available in all recorders (except the Computer Vision
recorder).
Copy Text
Generates a „Get Text‟
activity to copy the value of
a UI element and store it in
a new variable
Set Text
Generates a „Set Text‟
activity to input in a UI
element
Mouse Scrape
Generates „Click Text‟ Generates „Get Text‟ or
activities prompting the „Extract Structured Data‟ Select & Copy
user for the UI element activities using Screen
Generates a „Type Into‟ and
to click Scraping and Data
„Copy Selected Text‟
Scraping
activity prompting the user
for the UI element to copy
Image
It enables the user to work with images. It is available in all recorders (except Computer the Vision
recorder).
There are some actions that are available only in the Image Recorder.
Selectors are a fundamental part of Studio for identifying individual UI elements on the screen.
Selector Editor
Enables the user to see the automatically generated selectors and edit their attributes.
on the activity
4. Select the Edit
Selector option from
the context menu.
Properties of Selector Editor
• Validate
• Indicate Element
• Repair
• Highlight
Classroom Exercise
In Studio, selectors are of two types: Full Selectors and Partial Selectors. The differences between Full &
Partial Selectors are:
Editor
Section
Explorer
Section
Containers and Partial Selectors
Partial selectors work only inside a container. The advantages of using containers with partial selectors
are that a container:
Used to find the address of a UI element dynamically and identify the attributes of the element across
windows.
Format:
<tag attribute=`{{Value}}` />
A wildcard is a special character that can replace the dynamic part of a selector.
There are two types of wildcards:
Asterisk (*): Replaces zero or more characters Question Mark (?): Replaces a single character
UI Explorer
• Introduction to UI Explorer
• Panels in UI Explorer
• Fields in UI Explorer
Introduction to UI Explorer
Indicate Repair
Anchor Enables the user to
Enables the user re-indicate the same
to choose an target UI element to
anchor relative to repair selector
the target UI
element
Indicate Highlight
Element Highlights the element
Indicates a UI corresponding to the
element & displays current selector
its selector and tree
Options
Validate Switch between
Shows the status frameworks and
of the selector by explore options
checking its like Delayed
validity Restore, etc.
UI Frameworks
Anchors are labels used to interact with an element that has an unstable selector. Anchor Base activity
searches for a UI element by using other UI elements as anchors
1 2
Available options:
• Auto
• Left
• Top
• Right
• Bottom
• OnTop
Using Anchors in Webpage
The form fields on www.rpachallenge.com, change every time the webpage is refreshed.
Using Anchors in Webpage (Contd.)
Example: Fill the form on www.rpachallenge.com using the label “Company Name” The anchor “Company Name” displays the
as an anchor value of the element in the textbox
Classroom Exercise
For selectors, fine-tuning is used to refine them to have workflow executed correctly. There are cases
when fine-tuning of selectors is not sufficient, and several tools are used:
Visual Tree
Anchor Base Relative Selector Find Children
Hierarchy
This is an activity with A selector can be The hierarchy in the This activity can identify
two parts: improved by using the Visual Tree can improve all the children of an
• The first locates the „Indicate Anchor‟ option the reliability of a selector element that is more
anchor (which should in UI Explorer by including the tags and stable. It further needs a
not change) attributes of the element mechanism to identify
• The second performs that is above in the only the desired child
the desired action hierarchy
Approach to Fine-Tune Selectors
Use the Selector Editor to Identify the element Highlight the application after
inspect the applications causing the issue modifying attribute values
Examine the elements from Change element‟s attributes through „Indicate Test the functionality of the
the Selector Editor path Element‟ & use UI Explorer to find various recently debugged element
selectors using „Visual Tree‟
Classroom Exercise
3 Containers
6 Anchors