Lab Experiment 4,5,6,7,8,9 (Robotics)
Lab Experiment 4,5,6,7,8,9 (Robotics)
Aim:
Procedure:
· In the Activities pane, search for Input Dialog. Drag the Input
Dialog activity into the Sequence
Example: "Name: " + userName + "\nAge: " + age + "\nCity: " + city
1. Sequence:
o Inside the Sequence, you add three Input Dialog activities,
one for each input (name, age, and city).
2. Message Box:
o After gathering all inputs, a Message Box will show the
formatted string containing the user's input.
Output:
Result
Once you're satisfied with the workflow, you can save it and even
publish it if you're working within an enterprise environment that
requires deploying robots.
2.Create a Flowchart to navigate to a desired page based on a
condition
Aim:
Procedure:
This will create a blank flowchart where you will add your decision-
making logic and actions.
condition = True
Now you need to specify what happens if the condition is True or False.
True Branch:
False Branch:
Variables:
o condition (Boolean) → Initialized to True or False.
Flowchart:
Output
+---------------------------+
| Start |
+---------------------------+
+---------------------------+
+---------------------------+
+---------------------------+
| If condition = True? |
+---------------------------+
/ \
True / \ False
/ \
+-------------------+ +-------------------+
| "Navigating to | | "Navigating to |
+-------------------+ +-------------------+
+---------------------------+
| End |
+---------------------------+
Procedure
Procedure
Code
Assign RandomNumber = New Random().Next(1, 101)
<Activity x:Class="UiPath.Core.Activities.InputDialog"
DisplayName="Input Dialog">
<x:Members>
<sap:VirtualizedProperty Name="Result"
Type="OutArgument(System.String)" />
</Activity>
<x:Members>
<x:Property Name="Condition"
Type="InArgument(System.Boolean)" />
</x:Members>
</Activity>
<Activity x:Class="UiPath.Core.Activities.MessageBox"
DisplayName="Feedback">
<x:Members>
</x:Members>
</Activity>
Output
Result
Procedure:
XML
<Activity
x:Class="UiPath.Core.Activities.Browser.OpenBrow
ser" DisplayName="Open Browser"
sap:Virtualized="True" sap:Verifiable="True">
<x:Members>
<x:Property Name="BrowserType"
Type="InArgument(System.String)" />
<x:Property Name="Url"
Type="InArgument(System.String)" />
</x:Members>
<sap:VirtualizedProperty
Name="DisplaySettings"
Type="InArgument(UiPath.Core.Activities.Browser.
BrowserDisplaySettings)" />
<sap:VirtualizedProperty Name="NewSession"
Type="InArgument(System.Boolean)" />
</Activity>
Output:
Result: The RPA bot successfully automates the web-based task, saving
time and effort.
Procedure:
XML
<Activity
x:Class="UiPath.Core.Activities.Assign"
DisplayName="Assign" sap:Virtualized="True"
sap:Verifiable="True">
<x:Members>
<x:Property Name="To"
Type="OutArgument(System.Object)" />
<x:Property Name="Value"
Type="InArgument(System.Object)" />
</x:Members>
</Activity>
Output:
Procedure:
Example (UiPath):
XML Code:
XML
<Activity
x:Class="UiPath.Core.Activities.System.FileSyste
mTrigger" DisplayName="File System Trigger"
sap:Virtualized="True" sap:Verifiable="True">
<x:Members>
<x:Property Name="FilePath"
Type="InArgument(System.String)" />
<x:Property Name="EventType"
Type="InArgument(UiPath.Core.Activities.System.F
ileSystemEventType)" />
<x:Property Name="TriggerType"
Type="InArgument(UiPath.Core.Activities.System.T
riggerType)" />
</x:Members>
</Activity>
Output:
Procedure:
Output:
Result:
Procedure:
Output:
Result:
Procedure:
XML
<Activity
x:Class="UiPath.Core.Activities.Browser.OpenBrow
ser" DisplayName="Open Browser"
sap:Virtualized="True" sap:Verifiable="True">
</Activity>
<Activity
x:Class="UiPath.Core.Activities.Web.GetText"
DisplayName="Get Text" sap:Virtualized="True"
sap:Verifiable="True">
<x:Members>
<x:Property Name="Selector"
Type="InArgument(UiPath.Core.Selector)" />
</x:Members>
</Activity>
<Activity
x:Class="UiPath.Core.Activities.File.Write CSV"
DisplayName="Write CSV" sap:Virtualized="True"
sap:Verifiable="True">
<x:Members>
<x:Property Name="FilePath"
Type="InArgument(System.String)" />
<x:Property Name="DataTable"
Type="InArgument(System.Data.DataTable)" />
</x:Members>
</Activity>
Output:
Result:
Missing files
Incorrect data
Timeout errors
Application crashes
4.Log Errors:
Use activities like Log Message to log errors and Write to Log or
Write to File to record the exception details.
For example, in case of a timeout, you can retry the action a set
number of times before sending an email notification.
Or you can use Continue to skip a problematic step and proceed with
the rest of the automation.
Check if the process recovers from the error or stops gracefully, and
the error is logged correctly.
Program:
<Sequence>
<!-- Try block -->
<TryCatch>
<!-- Try block where the risky operation takes place -->
<TryBlock>
<ReadTextFile FilePath="C:\invalidfile.txt"
Output="fileContent" />
</TryBlock>
<Catch Exception="System.IO.FileNotFoundException">
</Catch>
<Catch Exception="System.Exception">
</Catch>
</TryCatch>
</Sequence>
Output:
Result:
Aim:
To perform a web scraping task using Robotics Process Automation
(RPA) to extract data from a website , automate the process, and store
the scraped data in a structured format.
Procedure:
• Use the built-in web scraping tool in the RPA software to capture
the data you want to scrape. This usually involves selecting elements on
the webpage such as titles, prices, and descriptions.
• Use activities like Data Scraping, Get Text, or Extract Structured Data
in the RPA tool to retrieve the data
• Use activities like Write CSV or Write to Excel to save the scraped
data.
• Execute the process and observe the RPA tool scraping the
required data from the webpage.
• Check the stored data in the CSV or Excel file to ensure the data is
scraped correctly.
Program:
2.Data Scraping:
3. Extract Data:
• • The wizard identifies the repeating pattern in the data (like rows
of product listings) and extracts each element such as the product name,
price, and description.
4. Write to Excel:
1.Use the Write Range activity to save the scraped data to an Excel
sheet.
<Sequence>
<OpenBrowser Url="https://www.example.com/products"
BrowserType="Chrome"/>
</Sequence>
Output:
Result:
Procedure:
In UiPath, use the Get IMAP Mail Messages or Get Outlook Mail
Messages activities to retrieve emails from a mailbox.
If the query contains the word "invoice," the bot can check for
invoice-related information.
6.Error Handling:
Program:
<Sequence>
<Assign>
messageBody = Item.Body
</Assign>
<If Condition="messageBody.Contains('invoice')">
<Then>
<SendOutlookMailMessage To="sender@example.com"
Subject="Invoice Query Response" Body="Dear Customer, your invoice
details are being processed."/>
</Then>
</If>
<If Condition="messageBody.Contains('support')">
<Then>
</Then>
</If>
<Then>
<SendOutlookMailMessage To="sender@example.com"
Subject="Query Received" Body="Dear Customer, we have received
your query and will get back to you shortly."/>
</Then>
</If>
</ForEach>
</Sequence>
Output: