Ui Path Academy - Error and Exception Handling in Studio
From a Throw Activity handled inside a TryCatch
How are Business Exceptions defined in a workflow?
Human intervention is required
How can Business Exceptions be addressed?
If an activity is included in Try Catch, in the Try section, and the value of the ContinueOnError property is True, no error is caught when the project is executed.
How do ContinueOnError and TryCatch activities interact?
new BusinessRuleException("ExceptionTextInfoGoesHere")
How do you instantiate a new business rule exception using the expression editor?
One
How many Global Exception Handlers can be set per automation project? Choose one of the options below One Depends on the type of exception Two Any number
a type of workflow
The Global Exception Handler is designed to determine the project's behavior when encountering an execution error. What is a Global Exception Handler? Choose one of the options below. an activity a property a menu a type of workflow
The Retry Scope Activity retries the activities until no exception occurs (or the provided number of attempts is exceeded).
The Retry Scope activity can be used without a termination condition. What does this infer? Choose one of the options below The Retry Scope Activity retries the activities indefinitely. It throws an exception. The Retry Scope Activity retries the activities until no exception occurs (or the provided number of attempts is exceeded). The Retry Scope Activity retries just once.
1
Up to how many Global Exception Handler are allowed per project?
Where the program contains no syntax errors but does not produce the expected results. These types of errors are often called bugs.
What are Programming errors?
Exceptions are events that are recognized (caught) by the program, categorized, and handled. More specifically, there is a routine configured by the developer that is activated when an exception is caught.
What are exceptions?
ignore retry abort continue
What are the four standard responses for a Global Exception Handler by default?
Where the software determines that the user's input is not acceptable for some reason.
What are user errors?
Surround the activity with Try/Catch Activity
What can you use to make sure that execution continues even if an Activity fails? Choose one of the options below. The Throw activity The TimeoutMS property AddThe DelayAfter property Surround the activity with Try/Catch Activity
Rethrow causes the initially thrown exception to be rethrown to handle the exception on an upper level.
What does Rethrow do?
The activity or set of activities to be performed when an exception occurs.
What does the Catches block in a TryCatch activity do?
The activity or set of activities to be performed after the Try and Catches blocks are executed.
What does the Finally block in a TryCatch activity do?
Attempt to perform the activity that has a chance of throwing an error
What does the Try block in a TryCatch activity do?
Element Exists File Exists Check True Check False
What four basic conditions activities can be used?
The execution of the project continues regardless of any error
What happens if the ContinueOnError Property is set to True? Choose one of the options below. The execution of the project continues regardless of any error The execution of the project stops based on the error The execution is retried An error is thrown
Closes all applications of the specified type e.g. close all excel files that are open.
What is Kill Process used for?
Describes an error rooted in a technical issue, such as an application that is not responding.
What is a ApplicationException?
Is thrown when a method is invoked and at least one of the passed arguments does not meet the parameter specification of the called method.
What is a ArgumentException?
A business exception mainly refers to information used in an automated process. Either it may be incomplete or incorrect from a business perspective.
What is a Business Exception?
The Global Exception Handler is a type of workflow designed to determine the process' behavior when encountering an unexpected exception.
What is a Global Exception Handler?
Occurs when an image is not found within the TimeOut period.
What is a ImageOperationException?
Occurs when the index of an object is out of the limits of the collection.
What is a IndexOutOfRangeException?
Occurs when using a variable with no set value (not initialized).
What is a NullReferenceException?
Is thrown when the robot is unable to find the designated selector for an activity in the target app within the TimeOut period.
What is a SelectorNotFoundException?
Occurs when the indicated text is not found within the TimeOut period.
What is a TextNotFoundException?
Where the compiler/interpreter cannot parse the written code into meaningful computer instructions.
What is a syntax error?
Errors are events that a particular program can't normally deal with.
What is an Error?
he ContinueOnError is a property that specifies if the execution of the activity should continue even when the activity throws an error.
What is the ContinueOnError property for?
The Retry Scope activity retries the contained activities as long as the condition is not met or an error is thrown.
What is the Retry Scope activity used for?
TryCatch activity catches a specified exception type in a sequence or activity and either displays an error notification or dismisses it and continues the execution.
What is the TryCatch activity used for?
No limit
What is the limit as to how many Catches you can use in a Try Catch activity? At least one Minimum two No limit By default three
There is no limit on the number of catches.
What is the maximum number of catches you can have in a Try/Catch block? Choose one of the options below Five Two One There is no limit on the number of catches.
Place the Click activity inside a Try/Catch block.
What is the most effective way to handle the click on a UI Element that is not always available? Choose one of the options below Use an Element Exists activity and then a Click activity. Set the ContinueOnError property of the Click activity to True. Use a Find Element Activity. Place the Click activity inside a Try/Catch block.
The difference is that Retry Scope activity simply retries the execution instead of providing a more complex handling mechanism.
What makes Retry Scope different from TryCatch?
NumberOfRetries and RetryInterval
What two properties are within the Retry Scope activity?
Actions and Conditions
What two sections are within the Retry Scope activity?
It'll retry the activities until no exception occurs or the provided number of attempts is exceeded.
What will happen if a Retry Scope activity is used without a termination condition?
Only inside a Catch block
When can Rethrow be used?
This section is executed only when no exceptions are thrown or when an error occurs and is caught in the Catches block
When does the Finally block executed?
When you want an exception thrown even if one wasn't generated by an activity.
When is the Throw activity used?
While using data scraping - So that the activity doesn't throw an error on the last page when the selector of the 'Next' button is no longer found. When we are not interested in capturing the error but simply in the execution of the activity.
When would setting the ContinueOnError property to True be recommended?
NullReferenceException IndexOutOfRangeException ArgumentException SelectorNotFoundException ImageOperationException TextNotFoundException ApplicationException
Which exceptions are derived from System.Exception?
An alternative to the approach that fails A LogMessage activity
Which of the following is recommended to have in a Catch block? Choose all the options that apply An Input Dialog activity No Activity An alternative to the approach that fails A LogMessage activity
Log Error Choose Next Behavior
Which predefined activities are contained within the Global Exception Handler?
errorInfo with the In direction - contains the information about the error that was thrown and the workflow that failed. result with the Out direction - used for determining the next behavior of the process when it encounters the error.
Which two predefined argument do Global Exception Handlers have? What are their directions?
The block with most specific match
You have more than one exception type defined in the Catch block and an exception occurs that fits two types. Which one of the following block is executed? Choose one of the options below The block with most specific match The block with most generic match The first match defined All matching blocks in the order they are defined
As long as an error is thrown As long as the condition is not met
In which of the following two cases does the Retry Scope retry the contained activities? Choose all the options that apply. As long as an error is thrown As long as the condition is met As long as the condition is met and an error is thrown As long as the condition is not met
Workflow
Is the Global Exception Handler an activity or workflow?
String
Review Question: To use a selector in the selector property of an activity, you can store it in a variable. What's the variable type? Choose one of the options below. String Int32 UiElement Boolean
Variables are automatically turned into arguments
Review Question: What happens when the "Extract as Workflow" option is used? Arguments are automatically turned into variables Variables are automatically turned into arguments Variables are used to pass information between the main workflow and the extracted one. Variables are manually turned into arguments
False
T/F: The Catches block may only assist with one exception type
False
T/F: The global exception handler is used with library projects
errorInfo has IN direction and result has OUT direction
The Global Exception Handler has two arguments, errorInfo and result. What are their directions? Choose one of the options below. errorInfo has IN direction and result has IN direction errorInfo has OUT direction and result has OUT direction errorInfo has IN direction and result has OUT direction errorInfo has OUT direction and result has IN direction
