Sol QB Subject - Robotic Process Automation Subject Code - BTCS9505
Sol QB Subject - Robotic Process Automation Subject Code - BTCS9505
a. Stepping through the Workflow: Debugging enables you to execute your workflow
step by step, allowing you to observe the execution flow and verify if each step is
functioning as expected.
b. Inspecting Variables: During debugging, you can inspect the values of variables at
different points in the workflow. This helps you track the flow of data and identify any
inconsistencies or unexpected values.
Sequences Flowchart
4. It provides a clear and concise 4.. It allows for branching using decision
representation of the workflow logic. activities, such as If, Switch, and Flow
Decision, to handle different scenarios
based on conditions.
Improved Efficiency: RPA can automate mundane, time-consuming tasks, such as data
entry, form filling, and report generation. This frees up human employees to focus on
more strategic and value-added activities, resulting in increased productivity and
efficiency.
Data Migration and Integration: RPA can be used to automate the migration of data
between different systems or to integrate data from multiple sources. This helps
streamline processes and ensures accurate and timely data transfer.
Customer Service and Support: RPA bots can assist with customer service activities by
automatically handling routine inquiries, updating customer information, and providing
quick responses. This enhances customer satisfaction and reduces response times.
Financial and Accounting Processes: RPA can automate tasks like invoice processing,
accounts payable/receivable, and financial report generation. It can extract relevant
information from documents, validate data, and update records, minimizing errors and
accelerating financial processes.
Supply Chain Management: RPA can optimize supply chain operations by automating
inventory management, order processing, and shipment tracking. Bots can monitor
stock levels, generate purchase orders, and update delivery status, ensuring smoother
operations and reducing delays.
7. Display “Hello Message” using Message Box & Write line
9. Explain various activities in UiPath: Type into, Send HotKey, Write line & Read
TextFile.
Type Into:
The Type Into activity is used to simulate keyboard input. It allows you to enter
text into input fields, text boxes, or other editable elements in an application or
web page
Send HotKey:
Write Line:
The Write Line activity is used to display information or messages during the
execution of a workflow.
The Read Text File activity is used to read the contents of a text file. It reads the
text from a specified file path and stores it in a string variable. You can then use
the variable to manipulate or process the text as per your requirements. It is
useful for reading configuration files, log files, or any other text-based data.
10. Create a workflow, to print the Fibonacci Series up to given number using
Do-While loop activity
11. Create a process in UiPath, by using these activities: Input Dialog, Read Range,
Write line & Read TextFile, Message Box. Also, mention the usage of these activities
Ans
1. Input Dialog: Prompt the user to enter input, such as a number or text.
Store the user's response in a variable for further processing.
2. Read Range: Read data from an Excel file or spreadsheet. Specify the
range of cells to read and store the data in a DataTable variable for further
manipulation.
3. Write Line: Display information or messages during the execution of the
workflow. It can be used for debugging or logging purposes.
4. Read TextFile: Read the contents of a text file. Store the text in a string
variable for further processing or display.
5. Message Box: Display a pop-up message box with a message. It is useful
for providing information, alerts, or notifications during the workflow
execution.
12. Explain the significance of the following activities. The Assign Activity, The Delay
Activity, The Break Activity, For Each Activity by suitable examples.
Assign Activity: The Assign activity is used to assign values to variables or update
variable values during the execution of a workflow. It is helpful for storing or
manipulating data.
Delay Activity: The Delay activity introduces a delay or pause in the workflow for a
specified amount of time. It is useful for adding wait times between actions or for
implementing time-based conditions
Break Activity: The Break activity is used to exit or terminate a loop prematurely. It is
typically used within a loop structure to break out of the loop when a specific condition
is met.
For Each Activity: The For Each activity is used to iterate over a collection or array and
perform actions on each element. It allows you to process each item individually
without explicitly specifying the index
For Each item in myArray iterates through each element in the array myArray and
performs actions on each item..
13. Automate the process to find the smallest and biggest numbers in an array.
1. Use an Input Dialog to prompt the user to enter a list of numbers, separated by
commas.
2. Split the input string by commas to create an array of numbers.
3. Use an Assign activity to initialize variables smallest and biggest. Set smallest
to a large initial value and biggest to a small initial value.
4. Use a For Each activity to iterate through each number in the array.
5. Within the For Each loop, use an If activity to compare each number with the
current values of smallest and biggest.
6. If the current number is smaller than smallest, update smallest with the current
number.
7. If the current number is larger than biggest, update biggest with the current
number.
8. After the For Each loop, use a Write Line activity to display the smallest and
biggest numbers.
9. Optionally, you can use a Message Box activity to show a pop-up message with
the smallest and biggest numbers.
14. Automate the process of checking whether a year entered by user is leap year or
not using Flow decision
Ans
17. Automate the workflow for changing the names of all the PDF files from a given
folder using the For Each loop and a couple of specific String methods
1. Use the Directory.GetFiles activity to get a list of all the PDF files in the given
folder. Store the file paths in an array variable, let's call it "pdfFiles".
2. Add a For Each activity and set the TypeArgument property to String. Set the
Values property of the For Each loop to "pdfFiles" variable.
3. Within the For Each loop, add the following activities:
a. Use the Path.GetFileNameWithoutExtension method to extract the file name
without the extension from the current file path. Store the result in a string
variable, let's call it "fileName".
b. Use the Path.GetExtension method to get the file extension from the current
file path. Store the result in a string variable, let's call it "fileExtension".
c. Use the Assign activity to construct the new file name. You can use specific
String methods like Replace, Substring, or any other required logic to modify the
"fileName" string as per your requirements. Store the modified file name in a
string variable, let's call it "newFileName".
d. Use the File.Move activity to rename the current PDF file. Set the source file
path as the current file path, and the destination file path as the combination of
the folder path, "newFileName", and "fileExtension".
4. Save and run the workflow.
18. Automate the workflow by using the Parallel activity to calculate tax based on the
user input
. 19. Create a Flowchart to navigate to a desired page based on a condition
21. Automate the process displaying current date and time using Date variable. Also
modify the program to print only date
currentDateTime = DateTime.Now;
5 .Add a Write Line activity to display the current date only USING EXPRESSSION:
currentDateTime.Date.ToString("yyyy-MM-dd");
6. Save and run the workflow. The current date and time will be displayed in the Output
22. Automate the process checking whether a number entered by user is prime or not
using do while and if-else activities
23. Automate the process displaying the files of any folder entered by user using for
each control structure.
1. Create a new workflow in UiPath Studio.
2. Use an Input Dialog activity to prompt the user to enter the path of the folder.
Store the user's response in a variable "folderPath".
10. Inside the For Each activity, add a Write Line activity to display each file name.
11. Set the Text property of the Write Line activity to the current item of the For Each
loop. You can use Path.GetFileName or any other required logic to extract the file
name from the file path.
12. Save and run the workflow.
Set the Text property of the Message Box activity to display the factorial value. Use the
following expression:
25. Automate the process displaying the days of the weeks for any given day number
entered by user using for switch activity.
1. Create a new workflow in UiPath Studio.
2. Use an Input Dialog activity to prompt the user to enter a day number. Store the
user's response in a variable, let's call it "dayNumber".
3. Add a Switch activity to the workflow.
4. Set the Expression property of the Switch activity to the value of "dayNumber".
5. Inside the Switch activity, add the following cases:
● Case 1: Enter the value 1 in the Case field.
● Add a Write Line activity inside this case to display "Sunday".
● Case 2: Enter the value 2 in the Case field.
● Add a Write Line activity inside this case to display "Monday".
● Case 3: Enter the value 3 in the Case field.
● Add a Write Line activity inside this case to display "Tuesday".
● Continue adding cases for the remaining days of the week, up to Case 7.
● Default case: Add a Write Line activity inside the Default case to display
"Invalid day number".
6. Save and run the workflow.
26. Copy one text file to another using Read text File and Write Text File activity
27. Perform an activity using if to show whether the input number is even or
odd.
1. Drag and drop an "Input Dialog" activity onto your workflow.Create two variables
of type Integer: inputNumber and result.
2. Drag and drop an "Assign" activity below the "Input Dialog" activity.
3. In the properties panel of the "Assign" activity, set the following properties:
● To: inputNumber
● Value: CInt(inputDialog.Result) (assuming the input dialog variable is
named inputDialog)
4. This step converts the user's input from a string to an integer and stores it in the
inputNumber variable.
5. Drag and drop an "If" activity below the "Assign" activity.
6. In the properties panel of the "If" activity, set the following condition:
● Condition: inputNumber Mod 2 = 0
7. This condition checks if the input number is divisible by 2, indicating an even
number.
8. In the "Then" section of the "If" activity, add an activity (e.g., "Message Box") to
display a message stating that the number is even.
9. In the "Else" section of the "If" activity, add an activity (e.g., "Message Box") to
display a message stating that the number is odd.
28. Perform Command Prompt activity using Type into and Click activity.
● Key: Ctrl+n
● This step will open a new Notepad window.
4. Drag and drop a "Send Hotkey" activity below the previous activity.
5. In the properties panel of the "Send Hotkey" activity, set the following properties:
● Key: Ctrl+v
● This step will simulate pasting the text into the Notepad window.
6. Drag and drop a "Write Text File" activity below the "Send Hotkey" activity.
7. In the properties panel of the "Write Text File" activity, set the following
properties:
● FileName: Specify the path of the Notepad file you want to write to.
● Text: Specify the text you want to write into the file.
30. Create a Sequence to obtain user inputs display them using a message box
1. Basic Recording:
● Basic Recording is a simpler and more user-friendly method.
● It captures user actions such as clicks and keystrokes.
● It provides a visual flowchart-like representation of the recorded steps.
● It is suitable for automating simple processes and tasks.
2. Desktop Recording:
● Desktop Recording is a more advanced recording method.
● It captures both user actions and screen images.
● It generates a sequence of activities based on the captured screen
images.
● It is more powerful and flexible, allowing for more complex automation
scenarios.
33. What is the difference between data scraping and screen scraping?
Extracting structured data from websites Extracting data from the user interface of
Purpose
or structured sources applications or systems
Source Websites, web pages, structured sources Application user interface
Identifying HTML structure and using Interacting with UI elements, OCR (Optical
Technique
selectors or patterns Character Recognition)
Web scraping, data extraction from web Integration with legacy or non-API
Use Case
pages applications
34. Perform an activity to Copy one excel sheet data to another excel sheet
1. Drag and drop an "Excel Application Scope" activity onto your workflow.
2. In the properties panel of the "Excel Application Scope" activity, specify the Excel
file
3. Within the "Excel Application Scope," drag and drop a "Read Range" activity.
4. In the properties panel of the "Read Range" activity, specify the sheet name or
range
Also, create a variable (e.g., dtData) of type DataTable to store the read data.
5. Drag and drop a "For Each Row" activity below the "Read Range" activity.
6. In the properties panel of the "For Each Row" activity, set the following properties:
● DataTable: dtData
● Body: Drag and drop a "Message Box" activity inside the body of the "For
Each Row" activity.
● In the "Message Box" activity, set the Text property to
row("Column1").ToString() (replace "Column1" with the appropriate
column name in your Excel sheet)
- WorkbookPath: "C:\Path\to\your\file.xlsx"
2. Write Cell
- SheetName: "Sheet1"
- Cell: "A1"
37. Read numbers from input file and write even & odd numbers to different
files.
Create a variable (e.g., inputNumbers) of type String to store the read text.
evenNumbers (String)
oddNumbers (String).
3. Drag and drop a "For Each" activity below the "Read Text File" activity.
● TypeArgument: System.String
● Values: inputNumbers.Split(Environment.NewLine.ToCharArray())
3. Drag and drop a "Write Text File" activity inside the "Then" branch of the "If"
activity.
4. In the properties panel of the "Write Text File" activity, specify the even numbers
file path using the "FileName" property.
5. Add another "Write Text File" activity inside the "Else" branch of the "If" activity.
6. In the properties panel of the second "Write Text File" activity, specify the odd
numbers file path using the "FileName" property. Use the "oddNumbers" variable
as the text to write.
38. Automate the process for sorting using Excel sheet activity.
39. Define data manipulation, also explain some business scenarios where it
can use.
Data manipulation refers to the process of altering, transforming, or modifying data to extract valuable
insights, prepare it for analysis, or meet specific business requirements. It involves applying various
operations, such as filtering, sorting, aggregating, joining, splitting, transforming, and calculating, to
manipulate the data in a meaningful way.
1. Data Cleansing: Cleaning and standardizing data to remove errors, inconsistencies, and duplicates.
This ensures data accuracy and reliability for analysis, reporting, and decision-making processes.
2. Data Transformation: Converting data from one format or structure to another. For example, converting
dates to a standardized format, changing data types, or transforming data into a suitable format for data
integration or reporting purposes.
3. Data Aggregation: Summarizing and consolidating data to create meaningful summaries or metrics.
Aggregating data allows businesses to analyze trends, patterns, and performance across different
dimensions, such as time periods, regions, or product categories.
4. Data Filtering: Filtering data based on specific criteria or conditions to focus on a subset of data that
meets certain requirements. This helps in identifying outliers, segmenting data, or extracting subsets for
further analysis.
5. Data Joins and Merging: Combining multiple datasets or tables to create a unified view of the data.
Joining data is useful when analyzing data from different sources or when merging data based on
common attributes, such as customer IDs or product codes.
6. Data Calculations: Performing mathematical or logical operations on data to derive new insights or
create derived measures. For example, calculating averages, totals, percentages, or applying formulas to
generate new metrics.
7. Data Splitting: Splitting data into multiple parts or subsets based on specific criteria. This can be useful
for segmenting data, creating test datasets, or distributing data across different systems or departments.
8. Data Formatting: Formatting data to enhance readability, consistency, or compatibility. This includes
formatting dates, numbers, currencies, or text strings to conform to specific standards or requirements
In the context of data manipulation, let's define the terms "object," "methods," and "properties":
2. Methods: Methods are actions or operations that can be performed on an object to manipulate or
transform its data. They represent a set of instructions or behaviors associated with an object that enable
specific operations to be carried out. In data manipulation, methods are used to perform actions such as
sorting, filtering, aggregating, or transforming data. For example, in Excel, methods like "Sort," "Filter," or
"Calculate" are used to manipulate data within a workbook.
3. Properties: Properties are attributes or characteristics of an object that describe its state or behavior.
They provide information about the object's data and define its specific characteristics. In the context of
data manipulation, properties represent the characteristics or attributes of data that can be accessed or
modified. For example, in a database table object, properties could include the table name, column
names, data types, or constraints.
42. Explain the regular expression in context of RPA, also explain some
business scenarios, and name the methods in UiPath that uses the RegEx.
Regular expression, commonly known as RegEx, is a powerful tool used in RPA (Robotic Process
Automation) for pattern matching and text manipulation. It allows you to define search patterns using a
combination of characters, metacharacters, and special syntax to identify and manipulate specific text
patterns within a larger body of text.
1. Data Extraction: Regular expressions are useful for extracting specific data patterns from unstructured
or semi-structured text. For example, extracting email addresses, phone numbers, or invoice numbers
from a document or extracting specific data elements from a web page.
2. Data Validation: Regular expressions help validate the format and integrity of data. For instance,
verifying that an input matches a specific pattern, such as validating a social security number, validating
email addresses, or validating credit card numbers.
3. Text Manipulation and Transformation: Regular expressions enable text manipulation by replacing or
modifying specific patterns within text. This can be helpful for tasks such as cleaning up or normalizing
data, removing unwanted characters, or reformatting text strings.
4. Parsing and Tokenizing: Regular expressions can be used to parse text by splitting it into meaningful
tokens based on specific patterns. This is useful for breaking down complex text structures into
manageable units for further processing or analysis.
In UiPath, several activities utilize regular expressions for text manipulation and pattern matching,
including:
1. Matches activity: This activity uses regular expressions to find all occurrences of a specified pattern
within a given input string. It returns a collection of matched results that can be further processed or used
for decision-making.
2. Replace activity: The Replace activity allows you to use regular expressions to find and replace specific
patterns within a text string. It enables you to replace matched patterns with desired values or modify the
text based on the defined pattern.
3. Is Match activity: This activity uses regular expressions to check if a given input string matches a
specific pattern. It returns a Boolean value indicating whether the input matches the pattern or not.
4. Split activity: The Split activity allows you to split a text string into an array of substrings based on a
specified regular expression pattern. It facilitates text parsing and tokenization by breaking down the text
into smaller units.
43. Explain the regular expression in context of RPA, also explain some
business scenarios, and name the methods in UiPath without the use of RegEx.
UiPath also provides alternative methods for text manipulation and pattern matching
without the use of regular expressions. Some of these methods in UiPath include:
44. Apply the concept of selectors, and construct a simple workflow, that
explain the structure of selector.
Selectors are a crucial concept in UiPath that define the structure and identify the elements of an
application's user interface (UI) that the robot interacts with. Selectors act as a unique identifier for UI
elements, allowing the robot to target and interact with specific elements accurately.
, let's consider an example where we automate the process of opening a web browser and navigating to a
specific website.
1. Open Browser activity: Drag and drop the "Open Browser" activity from the activities panel onto the
workflow . Configure the properties of the activity to specify the URL or website you want to open.
2. Attach Browser activity: Inside the "Open Browser" activity, add an "Attach Browser" activity. This
activity helps define the scope within which subsequent activities will be performed.
3. Web Browser Selector: In the properties of the "Attach Browser" activity, locate the "Selector" property.
This is where you define the structure of the selector for the web browser.
A selector typically consists of several attributes that uniquely identify the element. In this case, for the
web browser, the selector may include attributes such as "title" or "url" to identify the specific browser
instance or tab. The selector could look something like this:
In the above selector, "wnd" refers to the window element, "app" specifies the application (in this case, the
Chrome browser), and "title" identifies the specific window title.
4. Add activities within the Attach Browser scope: Within the "Attach Browser" activity, you can now add
activities to interact with the web page. For example, you can use the "Type Into" activity to enter text into
a search box or the "Click" activity to click on a specific button.
Each activity within the "Attach Browser" scope will automatically use the selector defined in the parent
"Attach Browser" activity, ensuring that the robot interacts with the correct web page
Selectors are a fundamental concept in UiPath and refer to the XML-based descriptions
that identify and locate UI elements within applications. They provide a unique
identification mechanism for automating interactions with specific elements of an
application's user interface.
The structure of a selector consists of a combination of attributes and values that
define the characteristics of an element. Here's an explanation of the different parts of a
selector:
example:
6.
47. Differentiate between partial selector and full selector.
48. Automate a process that extract the email address from a string
1. Assign activity: Create a variable (e.g., inputString) and assign the string from
which you want to extract email addresses.
2. Assign activity: Create an empty list variable (e.g., emailList) to store the
extracted email addresses.
3. While activity: Add a While activity to iterate through the input string until no more
email addresses are found. Configure the properties as follows:
● Condition: Set it to inputString.Contains("@") to check if the string still
contains an "@" symbol, indicating the presence of an email address.
4. Assign activity: Inside the While loop, assign the email address substring to a
variable. Use the IndexOf and Substring methods to extract the email address.
Configure the properties as follows:
● To: Set it to inputString.IndexOf("@") to get the starting index of the
email address.
● Length: Set it to inputString.IndexOf(" ",
inputString.IndexOf("@")) - inputString.IndexOf("@") to calculate
the length of the email address substring.
5. Assign activity: Update the input string by removing the extracted email address.
Use the Replace method to remove the email address from the string. Configure
the properties as follows:
● OldValue: Set it to emailVariable (the variable from the previous step).
● NewValue: Set it to an empty string ("").
● Result: Set it to inputString to update the input string for the next
iteration.
6. Add to Collection activity: Add the extracted email address to the emailList
using the Add to Collection activity. Configure the properties as follows:
● Collection: Set it to emailList.
● Item: Set it to the variable holding the extracted email address.
7. Message Box activity: After the While loop, add a Message Box activity to display
the extracted email addresses. Configure the properties as follows:
● Message: Set it to String.Join(Environment.NewLine, emailList) to
display the email addresses as a formatted list.
To automate a process by implementing selectors with wildcards in UiPath, you can follow these steps:
2. Inspect the selector of the element and determine which attribute or value can be replaced with a
wildcard.
3. Replace the specific attribute or value with a wildcard in the selector to make it more flexible. The
commonly used wildcards are:
4. Test the modified selector to ensure it still accurately identifies the desired element.
5. Use the modified selector in the appropriate activity to interact with the element in your automation
workflow Here's an example to illustrate the use of wildcards in a selector:
Let's say you have a button element in your application with the following selector:
If the button's ID attribute sometimes changes dynamically, you can use an asterisk (*) wildcard to match
any value for the ID attribute. The modified selector would be:
Now, you can use the modified selector in activities like "Click," "Type Into," or "Get Attribute" to interact
with the button element, regardless of its specific ID value.
50. Automate the process through which movies can be downloaded from
YouTube
1. Open the Amazon website in a web browser using the Open Browser activity
2. Use activities like Type Into or Click to search for the desired category or product in the search
bar.
3. Once you are on the search results page, inspect the HTML structure of the page to identify the
elements containing the product prices. Look for common attributes like class names or HTML
tags that can be used as selectors.
4. Use the Data Scraping wizard in UiPath to extract the prices of the products. Here's how to do it:
a. Click on the Data Scraping activity from the UiPath activities panel. b. Indicate the first
product's price element on the webpage. c. Follow the instructions in the Data Scraping wizard to
configure the extraction. d. Specify the column name for the price data. e. Extract the data from
the remaining products by following the same steps.
5. Once the data scraping is complete, you will have a DataTable containing the prices of the
products.
6. You can further manipulate or process the data as per your requirements. For example, you can
filter the prices, calculate the average price, or export the data to an Excel file.
To create an activity using the RE Framework, you can follow these step-by-step
procedures:
1. Create a new project in UiPath Studio and select the REFramework template.
2. Define the input arguments required for your automation process. These can
include any data or parameters needed to execute the process.
3. Modify the Init state to perform any initialization tasks, such as opening
applications, logging in, or setting up variables.
4. Customize the Get Transaction Data state to retrieve data or items to be
processed. This could involve reading from a file, querying a database, or
extracting information from a web page.
5. Implement the Process state, where the actual automation logic is performed.
This state can include activities like data manipulation, calculations, interaction
with applications, or web scraping.
6. Handle exceptions by adding the necessary error handling activities, such as Try
Catch blocks, within the Process state. These blocks help catch and manage
exceptions gracefully.
7. Update the Set Transaction Status state to handle the status of each transaction
or item being processed. This state is responsible for updating the transaction
status, marking it as completed or failed, and handling retries or exceptions.
8. Add logging activities throughout the workflow to capture important information
or errors. This helps in troubleshooting and monitoring the execution of the
automation process.
9. Customize the End Process state to perform any necessary clean-up tasks, such
as closing applications or releasing resources.
10. Run the automation project and monitor the execution. Check the logs for any
errors or exceptions and make necessary adjustments if needed.
53. Create an activity by using a state machine that explains the concept of
exception handling.
Certainly! Here's an example of an activity using a state machine that demonstrates the concept of
exception handling:
1. Create a new project in UiPath Studio and select the State Machine template.
3. Add states to the State Machine based on the different stages or tasks of your automation process. For
this example, let's consider three states: "Initialize," "Process Data," and "Finalize."
4. Within each state, you can add activities and logic specific to that state. Here's a breakdown of each
state and its activities:\
a. Initialize State:
- Add activities to initialize the application or system, such as launching an application or logging in.
- Use Try Catch blocks to handle any initialization errors or exceptions. Within the Catch block, you can
add activities to log the error details or perform any necessary recovery actions.
b. Process Data State:
- Add activities to perform data processing tasks, such as data manipulation, calculations, or
interacting with applications.
- Use Try Catch blocks to handle any errors or exceptions that may occur during data processing.
Within the Catch block, you can add activities to handle the error, log the details, and decide whether to
retry the operation or move to a different state.
c. Finalize State:
- Add activities to perform clean-up tasks, such as closing applications, releasing resources, or
generating reports.
- Use Try Catch blocks to handle any errors or exceptions that may occur during the finalization
process. Within the Catch block, you can add activities to handle the error, log the details, and ensure
proper clean-up.
5. Connect the states using transitions to define the flow of the automation process. For example, after
the "Initialize" state, you can transition to the "Process Data" state, and after the "Process Data" state, you
can transition to the "Finalize" state.
6. Additionally, you can add a global exception handler to handle unhandled exceptions throughout the
entire state machine. This can be done by adding a Global Exception Handler at the top level of the State
Machine workflow. Within the exception handler, you can add activities to log the exception details, notify
stakeholders, or perform any necessary actions.
Example: