Automation Student Developers Session 3: Introduction to UI Automation

UiPathCommunity 198 views 37 slides Jun 23, 2024
Slide 1
Slide 1 of 37
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37

About This Presentation

👉 Check out our full 'Africa Series - Automation Student Developers (EN)' page to register for the full program: http://bit.ly/Africa_Automation_Student_Developers

After our third session, you will find it easy to use UiPath Studio to create stable and functional bots that interact with ...


Slide Content

Introduction to the
UI Automation
21.06.2024Africa Series Day 3—Kickstart for Automation Student Developers

2
Senior RPA Developer @SterlingBank
UiPath MVP 2024
linkedin.com/in/emmanuel-kolawole/
Senior Consultant @dipoleDIAMOND
UiPath MVP 2024
linkedin.com/in/afeararomi/
Global Manager,
Marketing Community@UiPath
linkedin.com/in/crisvidu/
Emmanuel Kolawole Afe Araromi Cristina Vidu
Meet Today’s Hosts

3
About Today’s Session
•The meetup will not last for more than 1.5 hours
•You are encouraged to network and share your LinkedIn in the chat box
•We apologize for keeping you on mute till Q&A time
•Please use the chat to place questions too between now and Q&A

4
RPA Developer @FCMB
linkedin.com/in/ibraheem-shokunbi/
Ibraheem Shokunbi
Meet Today’s Speaker

5
1.Welcome
2.Session Agenda
3.About UI Automation and UI Activities
4.The Recording Tool: Basic, Desktop, and Web Recording
5.About Selectors and Types of Selectors
6.The UI Explorer
7.Using Wildcard Characters
8.QnA
9.Close out
Today’s Agenda

6
UI automation automates interactions with graphical user interface elements in software
apps, saving time and minimizing errors. This is done by using robots that perform tasks in
the same way as a human user, making it easier to automate complex business processes
and repetitive tasks such as Keyboard inputs, mouse movements and clicks , Reading
computer screen etc.
What is Ui Automation?
Mouse movements and
clicks
Keyboard inputs Reading computer screen

7
With Ui Automation in Robotic Process Automation it’s
possible to simulate the human interaction with
applications with UiPath Studio.
UiPath Studio uses interaction with most of the GUI
Frameworks (Desktop Applications, Web, Mainframe)
and recognizes different objects.
For every object a set of specific interaction is
available, for example:
•Write into TextBox
•Select Item from Dropdown
•Check/Uncheck Box
•Toggle RadioButton
Why use Ui Automation?

8
The following are the most used Activities related to Ui Automation:
•Click: the mouse interacts with an element (button, field, box..) to click on it. It’s
possible to use left/right button and also double click or click down/up.
•Type Into: compiles a text field with an input given. It could be a default input or
taken from a variable. Moreover it’s possible to use special keys during the Type
•Get Text: Reads a field and returns the text value inside. It’s possible to use
different “Scraping” method, to deal with particular objects that don’t retrieve the text
automatically.
•Select Item: Interacts with a dropdown and select the Item specified as input. When
spying the element, the list of items will be given.
Ui Activities

The Recording Tool

10
Recording tool
With the recording you can save a lot of time when creating an automation.
Using this functionality you can capture every interaction with the desktop/Browser
and automatically turn it to an activity inside your sequence.
You can record Click, Text typing, Checkboxes, Drop-downs, Mouse Hover and
Keyboard Shortcuts.

11
Modern Experience
Using the Modern Experience
automation, the recording tool is now
unique, so it’s not necessary to select the
App type in advance.
You can change the Automation
type from the Project Settings of
your automation.
If you select Modern Automation,
you can still use Classic Automation
as well.

12
Web Recording
•Used for recording in web apps and browsers
•Generates containers and uses Simulate Type/Click input method by
default
Desktop Recording
•Used when multiple actions are performed in many windows
•Suitable for all types of desktop apps
•Generates a container (with the selector of the top level) in which
activities are enclosed and partial selectors for each activity
•Faster than Basic recording
Basic Recording
•Used when multiple actions are performed in a single window and
generates a full selector for each activity
•Slow than the one that uses containers and is suitable for single
activities.
•Slower compared to Desktop recording
Basic, Desktop & Web Recording

13
Computer Vision Recording
•Used to visually identify all elements, rather than replying on selectors
or images & is suitable for automatically generating workflows that use
CV activities
Native Citrix Recording
•Used in Native Citrix automation projects & is the equivalent of the
Desktop recording for Citrix environments
Image Recording
•Used to record virtualized environments such as VNC, virtual
machines, and Citrix for image, text & keyboard automation
•Require explicit positioning
Image, Native Citrix & Computer Vision
Recording

14
More About Recording
All user interface elements are
highlighted while you record, as you can
see in the following screenshot, so that
you can be sure the correct buttons,
fields or menus are selected.
Regardless of the type
of recording selected,
some actions are
recordable and some
are not.
Recordable Non-Recordable
●Left-click on
buttons, check
boxes, drop-
down lists and
other GUI
elements
●Text typing
●Modifier keys
●Mouse hover
Note:
If you make changes to your display settings without restarting the
computer, elements are not going to be properly identified.

15
Text typing
Left clicks
Click on Check boxes
Click on Drop-downs
▪Following keyboard shortcuts can be used while recording:
▪F2–pauses the recording for 3 seconds. A countdown timer is displayed in the bottom
left corner of the screen. Can be useful with menus that automatically hide
▪Esc–exists the automatic or manual recording. If pressed again, recording is saved
as a sequence, and you return to the main view
During Recording, you can do….

16
More About Recording
After the Recording tool has been used, a sequence is created with all the
activities automatically generated.
HINT:
It’s always useful to check every selector for default values that could change from
time to time.
For example the Browser Url, a text-box that has dynamic values and so-on.
We will see in a few moments how to change selectors
Accordingly and follow best practice to make our automation
as dynamic and robust as possible.

17
Recording tool Example
https://www.rpasamples.com/unicornname

Selectors

19
Selectors
The Selectors are specific attributes related to an element that let the automation
uniquely identify it.
Every element has a specific selector.
When using recording or spy an element, a selector is automatically created and
most of the times it’s not necessary to change its attributes.
There are some attributes however that are dynamic, so it’s necessary to “tweak”
the selector values in order to make the automation stable.
You can see the selector of an element by clicking on the
Options menu and select Edit Target

20
By default a «Fuzzy Selector» is chosen, and
it is populated with some html tags.
Each row contains a «Node».
Node1 usually is the root node, that
represents the top window of the app.
You can check if there are some tags that
could change during runtime, for example:
•Text field related to input (eg. Dates)
•Browser Url
•Layout fields (eg. HTML paths)
Selectors

21
Selector Editor Window
Classic Design Modern Design
▪Enables the user to see the automatically generated selectors and edit their
attributes

22
Ui Explorer
An advanced tool that enables you to
create a custom selector for a specific
UI element.
It is available as a standalone tool you
can download from the Resource
Center in your Automation Cloud
instance, or from Studio only if the
UiPath.UIAutomation.Activities
package is installed as a dependency
to the project.

23
Validate
•Shows the status of
the selector by
checking the validity
of the selector
definition and the
visibility of the target
element on screen.
•Has the following
status:
•O (buffer): Selector
is being validated
•√: Valid selector
•×: Invalid selector
•?: Modified
selector, revalidate
Indicate Element
•Indicates a new UI
element to replace
the previous one
Repair
•Enables the user to
re-indicate the
same target UI
element and repair
the selector.
•The button is
available only when
the selector is
invalid
Highlight
•Brings the target
element in the
foreground.
•The highlight stays
on until its switched
off
•The button is
enabled only if the
selector is valid.
Indicate Anchor
•Indicates a new
anchor relative to
the indicated Ui
element
Properties of Ui Explorer

24
Full selectors:
●Contain all the elements needed to identify a UI element, including the top-level
window
●Generated by the Basic recorder
●Recommended when switching between multiple windows
Partial selectors:
●Generated by the Desktop recorder
●Do not contain information about the top-level window
●Activities containing partial selectors are enclosed in a container (Attach Browseror
Attach Window) that contains a full selector of the top-level window
●Recommended when performing multiple actions in the same window
Types of Selectors

25
Full Selectors
•Contain all the elements needed to identify a UI element,
including the top-level window
•Starts with a window or an HTML identifier
•Generated by the Basic Recorder
•Best suited when the actions performed require switching
between multiple windows
Partial Selectors
•Don’t contain the information of the top-level window, thus
the activities with partial selectors must be enclosed in
containers
•Generated by Desktop Recorder
•Best suited for performing multiple actions in the same
window
Full & Partial Selectors Sample

26
Types of Selectors
▪Used to find the address of a UI element dynamically and identify the attributes of the
element across windows:
•Use a variable or an argument as a property for the attribute of
the target tag
•Allows easy identification of a target element based on the value
of the variable or argument
•Best suited for situations in which the targeted element
constantly changes its value
Format
<tag attribute=‘{{Value}}’ />
•Tag: the target tag, such as <ctrl/>
•Attribute: the target attribute, such as name=‘menuItem’
•{{Value}}: the name of the variable or argument which holds the
property of the element the user wants to interact with
Dynamic Selectors

27
A wildcard is a special character that can replace the dynamic part of the selector.
There are two types of wildcards:
When a wildcard is used or a variable is added in between selectors, it is known as customizing selectors.
Asterisk
{*}
•Replaces zero or more
characters
Question
mark {?}
•Replaces a single character
Wildcards in Selectors

28
Selectors Demo

Data Scraping

30
Data Scraping/Table Extraction
Enables you to extract structured data from your browser, application or
document to a database, .csv file or even Excel spreadsheet.
Structured data is a specific kind of information that is highly organized and is presented in
a predictable pattern.
Classic Design
Modern Design

31
Data Scraping Demo
Open Web Browser Navigate to URL
https://acme-test.uipath.com/login
Enter User Credentials
and Login to the portal
Navigate to Work Items List
Extract Table Data
from multiple pages
Save captured data into an excel/csv file

32
Data Scraping/Table Extraction Exercise
▪Login to https://acme-test.uipath.com/login
▪Steps:
▪Open browser
▪Navigate to the above URL
▪Enter username and password
▪Sign in
▪Click Work Items
▪Use Data Scraping or Table Extraction
▪Click the table to be extracted
▪Follow the prompt
▪Add a write csv activity
▪run the .xaml file

Appendix

34
Open a Notepad file
•Save two files with different dates as the file name
• Create a new Sequence, give it a proper name and add an annotation
• Use an ‘Attach Window’ and indicate the Notepad file that is opened. Inside the container:
• Use a ‘Send hotkey’ to send Ctrl + h in order to replace 2 spaces with one
• Use 2 ‘Type into’ activities –one for the first field (with 2 spaces), and another for the second field (with 1
space)
• Use 2 ‘Click’ activities, one for the ‘Replace all’ button and the other for ‘Close’
• Open the second Notepad file and run the workflow. It will return the ‘Cannot find element’ error
• Open the selector for the ‘Attach window’ container. Point out that the title attribute contains the name of
the first file
•Use the repair function in the Selector Editor and point out that the part of the date that was different has
been replaced by “*”
• Open a third file and re-run the workflow. If it returns another error, replace the entire date by “*”
https://docs.uipath.com/studio/docs/selectors-with-wildcards
Selector Demo

35
Q n A
Thank You! Any Questions?

36
What’s Next?
Global Student Developer Chapter
https://community.uipath.com/global-student-developer/
Log in to UiPath Academy academy.uipath.com
●Go to the Learning Planspage
●Enrol for the Automation Developer Associate Trainingcourse
https://bit.ly/4c8mHem
●Take the “UI Automation with Modern Design in Studio” lesson
●Take the “Selectors in Studio Deep Dive” lesson
Session 4: Excel Automation and Data Manipulation
●Series Registration Page https://bit.ly/3Vz0G1d

37
Goodbye! But Stay Close…
[email protected]
●www.community.uipath.com
Happy Automation!