Summary

This document discusses debugging in UiPath. It details different debugging techniques, including setting breakpoints, slow step, step into, step over, highlighting elements, debugging tools, and the try-catch activity.

Full Transcript

IT3868/C-Robotic Debugging in Process Automation UiPath Understanding Debugging You can debug and catch exceptions in UiPath Exception An Exception is any error that disturbs the normal flow of instructions while executing a program. Exc...

IT3868/C-Robotic Debugging in Process Automation UiPath Understanding Debugging You can debug and catch exceptions in UiPath Exception An Exception is any error that disturbs the normal flow of instructions while executing a program. Exception is the amount of deviation in the output shown from the required business. Some general There are two main types exceptions are: Time of exceptions that we face exception, I/O in coding in UiPath studio. exception, user exception, class exceptions Exception Handling Responsive Precautionary Enables Process method to program to that occurs during avoid start from run-time deviations where it was interrupted Types of Exceptions In UiPath, there are mainly two types of exceptions: Business Rule Exception An exception that occurs in the business process is called a business System Exception exception. The disruption caused due to a system failure is called a system exception. Business Exception Definition Example Solution  Any deviation from  If the subject of an  To avoid business the standard email is not standard exception, use a business rule in a and keeps on unique identifier. process or activity is changing, the Robot called business will not be able to exception. pick it. This results in a business exception. System Exception Definition Example Solution  When the normal  If outlook is not  A System error can flow of the working, the robot be minimized by automation process will not be able to making the code is stopped due to the open any error proof. failure of system, it is attachment. This is called system categorized as exception. System error. Introduction to Debugging Debugging is the process of identifying and removing errors from a given project.  Step Into and Step Over  Validate Steps in debugging:  Breakpoints  Slow Step  Options  Logs Section Debugging Tools On Clicking “Start Debug”, three panels appear on the workstation screen: Locals Panel Cross-references different HTML pages and documents Properties Inspector Panel Output Panel Debugging Tools The most commonly Embeds managed components and windows form controls used tool for web page formatting Locals Panel The Locals Panel shows the values of all the variables in that scope and highlights the currently executing activity. Output Panel The Output Panel shows the detailed log of the current stage of workflow and the status of all activities executed by the Robot. Properties Inspector Panel The Properties Inspector Panel shows the active action properties, variable values declaration and debugging in the given data scope. Debugging Techniques Setting Breakpoint Slow Step Methods and Techniques of Debugging Highlight elements Step Into Step Over Setting Breakpoints Setting Breakpoints  It is used when the user wants to pause the program at a specific location. Other Debugging Techniques Step Into  It is used to start execution from the part where the user has indicated the breakpoint. Step Over  It is used to jump to the next activity from the part where the user has indicated the breakpoint. Other Debugging Techniques (Contd.) Slow Step  It is used to reduce the execution speed of the process. Highlight Elements  It shows the effect of the current application over the other application element, while the debugging mode is on. Common Automation Issues Some common problems that occur in automation process are: Element not found Timing Issue Element Not Found This error occurs when the element, with which the UiPath is trying to interact, does not appear on the screen. The possible reasons are: Visibility of Window The application is running in the background Reasons for Error Selector Selector of the element is not correct Strategy for Solving the Issue The steps for solving the ‘Element not found’ error are: Step 1:. Send a window message. Step 2: Click on “Indicate on screen”. Strategy for Solving the Issue (Contd.) The steps for solving the ‘Element not found’ error are: Step 3: Click on “UI Explorer”. Timing Issue This error occurs when the required screen takes more than the expected time to load. Cause of Timing Issue  Latency of system response or application response Example time  The time taken to load a webpage is dependent on the network speed of the internet Strategy for Solving the Timing Issue Steps for solving the timing issue: Step 1: Drag the Open application activity and type the URL “https://www.linkedin.com/”. Strategy for Solving the Timing Issue (Contd.) Steps for solving the timing issue: Step 2: Use the activity “Drag the Element Exists “ and highlight “Linkedin”. Strategy for Solving the Timing Issue (Contd.) Steps for solving the timing issue: Step 3: Click on the property tab of the ElementExists and create a variable with the name “linkedin” in the output column. Strategy for Solving the Timing Issue (Contd.) Steps for solving the timing issue: Step 4: Drag an ‘if condition’ and write the condition “linkedin = true”. Strategy for Solving the Timing Issue (Contd.) Steps for solving the timing issue: Step 5: Drag the Type Into activity and write the username and password. Try Catch Activity One of the most reliable methods that we use in UiPath to identify the reason of failure is Try Catch activity. It is used to enable the program to recover from specific error instead of crashing and terminating Try Catch the whole workflow. Activity It can be found in the activities panel. To use Try-Catch activity, we need to drag and drop it inside the workflow. Try Catch Activity (Contd.) For handling errors in Try Catch block, the workflow is divided into 3 parts: Try Block All the possible activities that can create or cause error should be placed in this block. Catch Block The user can add multiple type of catches in this block. Finally Block It is used for the actions to be performed after the Try & Catch blocks. Try Catch Activity (Contd.) Steps of Try Catch Activity are: Step 1: Drag the Try- Catch activity. Try Catch Activity (Contd.) Steps of Try Catch Activity are: Step 2: Drag a sample sequence or workflow inside it. Try Catch Activity (Contd.) Steps of Try Catch Activity are: Step 3:  Click on “Catches”  Choose “System. Exception”  Press Enter Try Catch Activity (Contd.) Steps of Try Catch Activity are: Step 4: The user will get room for the actions in the Catches section. Step 5: In the Catch block, add activities to take place when an error occurs in the main workflow. Try Catch Activity (Contd.) Steps of Try Catch Activity are: Step 6: Add the log command. Step 7:  Drag and drop the Log Message command inside the Catch block.  Choose the level “Warn”.  In the message column, write, “an error”+exception. Message. Throw Activity The Throw Activity is used to throw a specific type of exception that the user wants to throw. The Catch block handles that particular type of exception and performs the action that the user wants to perform on that exception. The Throw Procedure Step 1: Drag and drop the Try-Catch activity and drag the Throw activity inside the Try block. The Throw Procedure (Contd.) Step 2: Click on the property tab of the Throw activity and write the exception type that the user want and write the message that you want to show in (“ ”). The Throw Procedure (Contd.) Step 3: Go to the Catch block and choose the same condition that user has written in the Throw block. The Throw Procedure (Contd.) Step 4: Drag the Write line inside the Catch block and write “exception.Message”.

Use Quizgecko on...
Browser
Browser