Skip to main content

Agent Error Handling

You can configure an agent to react to errors in two different ways. You can configure the error handling properties for an action command, or you can use a custom script to watch for an error condition and take appropriate action.

Action Command Error Handling

Error Handling property specifies how the agent should react when an error occurs while executing the command action.

These are the Error Handling properties:

Action_command_error_handling.png

In the example below, you can retry if the Navigate Link action failed:

Action_Command_Error_Handling03.gif

Navigate Link Error Handling

 

Error Handling

Description

Exit Command

The agent will exit the action command and continue executing the next command. The agent will skip all sub-commands of the action command.

"Exit Command" is the default setting for the Error Handling property.

No Error Handling

The agent will not handle the error but will continue to execute the sub-commands of the action command.

Use this option if you want to handle the error in a custom script later in the process.

You can handle the error in sub-commands by using the script parameter "IsParentCommandActionError".

Retry Command

The agent will retry the action command a specified number of times, and if the action command does not succeed, it will skip all sub-commands of the action command and continue executing the next command. Set the property Retry Count to specify the number of retries. If Retry Count is set to zero the agent will keep retrying the command indefinitely.

Retry with No Error Handling

It is combination of "Retry Command" and "No Error Handling".

The agent will retry the action command a specified number of times but then continue with no error handling.

Restart and Resume Agent

The agent will restart and continue where it left off. This option is useful if an error puts the website into a state where the agent cannot continue.

Stop Agent

The agent will stop if an error occurs while executing the command action.

 

Error Handling In An Execute Script Command

You can use Execute Script Commands to implement advanced error handling, such as in these cases:

  • A required element is missing from a web page

  • An error message is displayed on a web page

  • An error occurs during the execution of an action command.

You can write a custom script in C# or VB.NET, or you can use the default script options to generate a default script without writing any .NET code.

ExecuteScriptRetryCommand.png

This default script retries a parent command if a selection is missing

Error_Handling_In_An_Execute_Script_Command02.gif

Creating Retry using Execute Script Command

An Execute Script Command has a corresponding web selection, and the script can use this web selection to check for any errors. The script also is given the parameter IsParentCommandActionError, which is set to True if the parent action command encounters an error while executing the command action.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.