- Overview
- UI Automation
- UI-ANA-016 - Pull Open Browser URL
- UI-ANA-017 - ContinueOnError True
- UI-ANA-018 - List OCR/Image Activities
- UI-DBP-006 - Container Usage
- UI-DBP-013 - Excel Automation Misuse
- UI-DBP-030 - Forbidden Variables Usage In Selectors
- ST-DBP-021 - Hardcoded Timeout
- UI-PRR-001 - Simulate Click
- UI-PRR-002 - Simulate Type
- UI-PRR-003 - Open Application Misuse
- UI-PRR-004 - Hardcoded Delays
- UI-REL-001 - Large Idx in Selectors
- UI-SEC-004 - Selector Email Data
- UI-SEC-010 - App/Url Restrictions
- UI-USG-011 - Non Allowed Attributes
- SY-USG-013 - Private File Invoke
- SY-USG-014 - Incorrect Execution Template Placeholders
- Applications and technologies automated with UI Automation
- UiPath Browser Migration Tool
- Computer Vision Recorder
- Click
- Hover
- Type Secure Text
- Send Hotkey
- Type Into
- Check
- Select Item
- Select Multiple Items
- Get Text
- Set Text
- Activate
- Highlight
- Set Focus
- Anchor Base
- Context Aware Anchor
- Find Relative Element
- Indicate On Screen
- Element Exists
- Find Element
- Wait Element Vanish
- Find Children
- Get Ancestor
- Element Scope
- Get Attribute
- Set Clipping Region
- Get Position
- Take Screenshot
- Wait Attribute
- On Element Appear
- On Element Vanish
- Click Text
- Hover Text
- Find Text Position
- Get Full Text
- Get Visible Text
- Extract Structured Data
- Text Exists
- Click OCR Text
- Hover OCR Text
- Get OCR Text
- Find OCR Text Position
- Microsoft OCR
- Microsoft Project Oxford Online OCR
- Microsoft Azure Computer Vision OCR
- Tesseract OCR
- Google Cloud Vision OCR
- OCR Text Exists
- Click Image
- Hover Image
- Find Image Matches
- Image Exists
- Find Image
- Wait Image Vanish
- On Image Appear
- On Image Vanish
- Load Image
- Save Image
- Attach Browser
- Close Tab
- Go Back
- Go Forward
- Go Home
- Inject JS Script
- Navigate To
- Open Browser
- Refresh Browser
- Set Web Attribute
- Attach Window
- Close Window
- Get Active Window
- Hide Window
- Maximize Window
- Minimize Window
- Move Window
- Restore Window
- Show Window
- Export UI Tree
- Invoke ActiveX Method
- Inject .NET Code
- Click Trigger
- Key Press Trigger
- Click Image Trigger
- System Trigger
- Hotkey Trigger
- Mouse Trigger
- Get Event Info
- Monitor Events
- Get Source Element
- Replay User Event
- Block User Input
- Use Foreground
- Element Attribute Change Trigger
- Element State Change Trigger
- Callout
- Copy Selected Text
- Get From Clipboard
- Set To Clipboard
- Close Application
- Open Application
- Start Process
- Get Password
- Tooltip
- Click Picture on Screen
- Click Toolbar Button
- Read Statusbar
- Select Dates in Calendar
- Select Menu Item
- Expand Tree
- Call Transaction
- SAP Logon
- SAP Login
- Table Cell Scope
- SAP Session Attributes Change Trigger
- Expand ALV Tree
- Expand ALV Hierarchical Table
- Use Application/Browser
- Check App State
- Check/Uncheck
- Click
- Extract Table Data
- Get Text
- Get URL
- Go to URL
- Highlight
- Hover
- Keyboard Shortcuts
- Navigate Browser
- Select Item
- Take Screenshot
- Type Into
- Get Attribute
- Get Browser Data
- Set Browser Data
- Mouse Scroll
- Inject Js Script
- Drag and Drop
- For Each UI Element
- Application Event Trigger
- Click Event Trigger
- Keypress Event Trigger
- Set Text
- Check Element
- Fill Form
- Perform browser search and retrieve results using UI Automation APIs
- Web Browsing
- Find Images
- Click Images
- Trigger and Monitor Events
- Create and Override Files
- HTML Pages: Extract and Manipulate Information
- Window Manipulation
- Automated List Selection
- Find and Manipulate Window Elements
- Manage Text Automation
- Load and Process Images
- Manage Mouse Activated Actions
- Automate Application Runtime
- Automated Run of a Local Application
- Browser Navigation
- Web Automation
- Trigger Scope Example
- Computer Vision Local Server
- Mobile Automation
- Release notes
- Project compatibility
- Get Log Types
- Get Logs
- Get Page Source
- Get Device Orientation
- Get Session Identifier
- Install App
- Manage Current App
- Manage Other App
- Open DeepLink
- Open URL
- Mobile Device Connection
- Positional Swipe
- Press Hardware Button
- Set Device Orientation
- Take Screenshot
- Take Screenshot Part
- Element Exists
- Execute Command
- Get Attribute
- Get Selected Item
- Get Text
- Set Selected Item
- Set Text
- Swipe
- Tap
- Type Text
- Draw Pattern
- Terminal
HTML Pages: Extract and Manipulate Information
The example below explains how to automate the action of browsing a web page, extract information and use it for creating a new, local HTML page. It presents activities such as Type Into, Click, Get Text, and Open Browser. You can find these activities in the UiPath.UIAutomation.Activities package.
This is how the automation process can be built:
- Open Studio and create a new Process.
- Open Internet Explorer and navigate
to
www.goodreads.com
. -
Drag a Flowchart container in the Workflow Designer.
-
Create the following variables:
Variable Name
Variable Type
Default Value
bookFound
String
 bookName
GenericValue
Â
-
-
Drag an Input Dialog activity inside the Flowchart container and connect it to the Start node.
- Double-click the activity in order to open it.
- Add the expression
"Book Name:"
in the Title field. - Add the expression
"Enter the name of a book you read:"
in the Label field. - In the Properties panel, add the
variable
bookName
in the Result field. -
The activity should look like in the following screenshot:
- Return to the Flowchart screen.
-
Drag a Sequence container and connect it to the Input Dialog activity. This is used for creating a new
.html
file.-
Create the following variable:
Variable Name
Variable Type
Default Value
fileExists
Boolean
Â
-
-
Double-click the Sequence container to open it and drag a Path Exists activity inside it.
- Select the File option from the Path Type drop-down list.
- Add the expression
"books.html"
in the Path field. - In the Properties panel, add the
variable
fileExists
in the Exists field.
-
Drag an If activity below the Path Exists activity.
- Add the variable
fileExists
in the Condition field.
- Add the variable
-
Place a Write Text File activity in the Else field.
- Add the expression
"books.html"
in the FileName field. -
Add the code below in the Text field.
<html> <head> <title>Books</title> </head> <body> </body> </html>
-
The activity should look like in the following screenshot:
- Add the expression
- Return to the Flowchart screen.
-
Drag an Open Browser activity and connect it to the Sequence container.
- Double-click the activity in order to open it.
- In the Properties panel, select the IE option from the BrowserType drop-down list.
- Add the expression
"https://www.goodreads.com/search"
in the Url field. This opens the specified website. - Select the check box for the NewSession option. This opens a new session of the selected browser.
-
Select the Do container from inside the Open Browser activity and create the following variable:
Variable Name
Variable Type
Default Value
noResults
GenericValue
 -
Drag a Type Into activity inside the Do sequence.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the desired
application. The GIF below shows all the steps you need to follow:
- Add the variable
bookName
in the Text field.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the desired
application. The GIF below shows all the steps you need to follow:
-
Place a Click activity below the Type Into activity.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the desired
application. The GIF below shows all the steps you need to follow:
- In the Properties panel, add the
value
1000
in the DelayBefore field. A delay of one second happens before performing any operation.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the desired
application. The GIF below shows all the steps you need to follow:
-
Drag a Get Text activity below the Click 'INPUT' activity.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the desired
application. The GIF below shows all the steps you need to follow:
- In the Properties panel, add the
variable
noResults
in the Value field.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the desired
application. The GIF below shows all the steps you need to follow:
-
Drag an If activity below the Get Text 'H3' activity.
- Add the expression
noResults.toLower.Trim.Contains("no results")
in the Condition field.
- Add the expression
- Place a Sequence container inside the Then field.
-
Drag a Message Box activity inside the Sequence container.
- Add the message
"Book not found. Please search another one."
in the Text field. If no result is available, then this message is displayed.
- Add the message
- Drag a Close Tab activity below the Message Box activity. This closes the tab open in the web browser.
- Place a Sequence container inside the Else field.
-
Drag a Get Text activity inside the Sequence container.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the desired
application. The GIF below shows all the steps you need to follow:
- In the Properties panel, add the
variable
bookFound
in the Value field.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the desired
application. The GIF below shows all the steps you need to follow:
-
Drag an If activity below the Get Text 'SPAN' activity.
- Add the expression
bookFound.ToLower.Trim.Contains(bookName.ToLower.Trim)
in the Condition field.
- Add the expression
-
Drag a Sequence container inside the Then field and create the following variable:
Variable Name
Variable Type
Default Value
realName
String
 -
Place a Click activity inside the Sequence container.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
-
Drag another Sequence container below the Click 'SPAN' activity, name it
Get book Details
and create the following variables:Variable Name
Variable Type
Default Value
description
GenericValue
 author
GenericValue
 booksContent
String
 alreadyExists
Boolean
 -
Drag a Get Text activity inside the Sequence container.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
- In the Properties panel, add the
variable
realName
in the Value field.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
-
Place an Assign activity below the Get Text 'H1 bookTitle' activity.
- Add the variable
realName
in the To field. - Add the expression
realName.Replace(":","").Replace("'","").Trim
in the Value field.
- Add the variable
-
Add a Path Exists activity below the Assign activity.
- Select the File option from the PathType drop-down list.
- Add the expression
Environment.CurrentDirectory+"\"+realName+".jpg"
in the Path field. - In the Properties panel, add the
variable
alreadyExists
in the Exists field.
-
Drag another If activity below the Path Exists activity.
- Add the variable
alreadyExists
in the Condition field.
- Add the variable
- Place a Sequence container inside the Then field.
-
Drag a Message Box activity inside the Sequence container.
- Add the message
"Book already added."
in the Text field. - In the Properties panel, select the Ok option from the Buttons drop-down menu.
- Add the message
- Drag a Close Tab activity below the Message Box activity. This closes the tab opened in the web browser.
- Place a Sequence container inside the Else field.
- Place another Sequence container inside the previous one.
-
Drag a Get Text activity inside the Sequence container.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
- In the Properties panel, add the
variable
description
in the Value field.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
-
Drag a Get Text activity below the getDescription activity.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
- In the Properties panel, add the
variable
author
in the Value field.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
-
Drag a Click activity below the getAuthor activity.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
- In the Properties panel, select the BTN_RIGHT option from the MouseButton drop-down list. This action right clicks on the image and a menu is displayed.
- Add the value
89
in the OffsetX field. - Add the value
22
in the OffsetY field. - Select the TopLeft option from the Position drop-down list.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
-
Drag a Delay activity below the Click 'IMG coverImage' activity.
- In the Properties panel, add the
value
00:00:02
in the Duration field. This provides a two-second delay.
- In the Properties panel, add the
value
-
Place a new Click activity below the Delay activity.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
-
Drag a Type Into activity below the Click 'menu item' activity.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
- In the Properties panel, add the
expression
Environment.CurrentDirectory+"\"+realName+".jpg"
in the Text field.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
-
Place a Click activity below the Type Into 'Edit' activity.
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
- Inside the activity, click the
Indicate element inside browser option. Now you can select the book's title.
The GIF below shows all the steps you need to follow:
-
Drag a Write Text File activity underneath the Click 'Button' activity.
- Add the expression
realName+".html"
in the FileName field. -
Add the below code in the Text field.
"<html> <head> <title>"+realName+"</title> </head> <body> <a href='books.html'>BACK</a> <h1>"+realName+"</h1> <h2>by "+author+"</h2> <img href='"+realName+".jpg'> <h3>"+description+"</h3> </body> </html>"
"<html> <head> <title>"+realName+"</title> </head> <body> <a href='books.html'>BACK</a> <h1>"+realName+"</h1> <h2>by "+author+"</h2> <img href='"+realName+".jpg'> <h3>"+description+"</h3> </body> </html>"
- Add the expression
-
Place a Read Text File activity below the Write Text File activity.
- Add the expression
"books.html"
in the FileName field. - Add the variable
booksContent
in the Content field.
- Add the expression
-
Drag another Write Text File activity underneath the Read Text File activity.
- Add the expression
"books.html"
in the FileName field. - Add string
booksContent.Replace("</body></html>","<h1><a href='"+realName+".html'>"+realName+"</h1></body></html>")
in the Text field.
- Add the expression
- Add a Close Tab activity below the Write Text File activity.
-
Drag an Open Browser activity below the Close Tab activity. This opens the newly created
.html
file.- Select the IE option from the BrowserType drop-down list.
- Add the expression
"file:\\\"+Environment.CurrentDirectory+"\books.html"
in the Url field.
- Return to the initial If activity and add a Sequence container inside the Else field.
-
Drag a Message Box activity inside the Sequence container.
- Add the expression
"Book not found. Please check the name and try again"
in the Text field.
- Add the expression
- Add a Close Tab activity below the Write Text File activity.
- Run the workflow. The automation process
requests a book name, searches it on www.goodreads.com, retrieves information about the
book, creates a basic
.html
page, and populates it with the retrieved information.