Lesson 14 Debugging and Exception Handling
Lesson 14 Debugging and Exception Handling
In RPA, there are six steps which are helpful in error handling:
▪ Step Into and Step Over
▪ Validate
▪ Breakpoints
▪ Slow Steps
▪ Options
▪ Logs Section
You can use “F7 key to run the debugging process and F9 key for
breakpoint purpose”.
You can continue the activity by clicking on the resume button which
can start your breakpoint activity on the last activity basis.
1. Step Into : It is used to start execution from the part where the
user has indicated the breakpoint.
2. Step Over: It is used to jump to the next activity from the part
where the user has indicated the breakpoint.
Note* Both the activities cannot work simultaneously, they can only
work one by one. They are used only when the user has indicated a
breakpoint.
4. Highlight Elements:
It shows the effect of the current application over the other
application element, while the debugging mode is on. This is only
helpful for the input and output activities.
Find Element: It will stop or pause until it finds a specified element on the
screen. Once it is found then it will wait for 30 seconds before throwing an error.
Wait element vanish: It will pause the process until the specified element
disappears from the screen. Once it disappears then it continues the process after
waiting for 30 sec.
Workflow Designs
Workflow designs define the process of creating a project or an
activity.
The features of a workflow process are:
▪ Layout
▪ Choice
▪ Naming Conventions
▪ Comments and Annotation
A. Flowchart
Flowcharts offer flexibility for connecting activities and tend to lay
out a workflow in a plane two-dimensional manner.
B. Sequence
The sequence is a part of the simple linear process representation in
UiPath. It flows a process top to bottom and then, it follows the
scenario of other activities.
C. State Machine
It is a complex automation structure which uses the various number
of state process in the execution process. you can create any
process in a state by trigger activity which can be exited by the
same where you create a process. But when another activity is
triggered, that is the whole process is known as a state machine.
You can define the states with the help of arrows and branches in
the flowchart that is called transition. It is two types of the state
machine:
▪ Start state
▪ End state
RPA Design & Development v1.1 July 2019 32
Choice
The choice and decision workflow process implement multiple types
of conditions. It makes capable data processing and app interaction
where the robot can take any action easily by these workflow
processes.
• If Activity
• Flow Decision
• Switch Activity
B. Credentials
No-one credentials should be stored in the workflow process
directly, but instead it should be loaded from safer places such as
local Windows Store or Orchestrator assets.
C. Error Handling
The two types of programming exceptions that may happen when
you run an automated process are: somewhat predictable or
unexpected.
Placing can control Exception propagation susceptible code inside
Try/Catch blocks where situations can appropriately handle. At the
highest level, the primary process diagram must define broad
corrective measures to address all general exceptions and to ensure
system integrity.
You can take vertical programming propagation mechanism to avoid
the duplicate process which wield the all exception error in an
individual place. Usually the exception and source message is the
RPA Design & Development v1.1 July 2019 39
crucial part where the source is indicating the name of activity in
case it is failed. Again the name is vital process that clear the
indication component.
D. Code Reusability
During the software or robot development we need to automate
multiple steps in the projects or workflow. So, it should be a
standard practice to create workflows that contain small pieces of
occurring automation and add them to the Library. Separating
business logic with the help of automation components is a moral
principle which is helpful to develop a code and abide to reuse in bot
development.
B. Maintainability
▪ Good structure and development standards
C. Readability
▪ Standardized process structure encouraging clear development
practices
▪ It has meaningful names for activities, workflow files, arguments
and flexible variables.
▪ Always lay climate setting in orchestrator and configuration
setting which is helpful to run automation procedure in testing
and production process.
D. Reliability
▪ Exception handling and error reporting
▪ Real-time execution progress update
1. Try-Catch Activity
It is used to recover from specific error instead of crashing and
terminating the whole workflow. The Try-Catch activity can be found
in the activities panel. To use Try-Catch activity, we will drag and
drop it inside the workflow.
Step 4: Now user will get room automatically for the actions in the
Catch section.
Step 5: In this Catch block now you can add activities to take place
when an error occurs in the main workflow.
Step 6: We should also add the log command because that gives us
an advantage if we are debugging a workflow that run unattended.
Step 7: Drag and drop the “Log Message” command inside the
Catch block and for the level we are choosing “Warn” and for the
message we are saying “an error”+exception.Message*.
Note**: exception. Message will show you the error message that
is coming.
In this project, we haven't added any activity inside the finally block
because it depends on the requirement. User can perform any task
or action in every condition, then users can drop those action in
Finally block.