As everyone who uses a browser knows, things frequently don't go how you expect. Web sites go down, connections fail, systems and computers experience problems. You might be wondering, how can I make my scripts run reliably in the face of all this unreliability? One way that you can manage the unreliable world is by using Timeouts and Error Handlers.
Timeouts and Error Handlers can be configured on any playable item, including requests, navigations, and even Steps. If you configure a timeout for a Step the timeout will govern the whole Step so that the sum of the times for all the items in the Step will be limited to the timeout period.
Configuring a TimeoutTo add a timeout, simply open the properties for the item on which you would like to configure the timeout and choose the "Playing" tab:

Once a timeout is configured, Badboy will monitor the item as it plays and if the time you set is exceeded, Badboy will execute the Continuation action you specified.
Notes and LimitationsErrors include problems like server failures, HTTP protocol errors (for example, 404 Not Found), or network failures. By default, when an error occurs, Badboy will simply note the error and continue playing the next item in the script. You can change this behavior by configuring handling for errors on the Playing tab of the item, or on a parent of the item such as the Step or Test that it resides in.
The figure below shows how the error handling section of the properties dialog appears:

To make Badboy completely ignore an error, you can enter a regular expression pattern ("regex") that matches the URL for which the error occurs, or which matches the error message that is reported by Badboy. You only need to match a portion of the error for the match to succeed.
To make Badboy ignore all errors on an item, enter the regex pattern: .*
To configure other handling for errors, change the "Action on Error" drop down box to specify the action you would like. For example, you can make Badboy abort the current Test if an error occurs, or repeat the containing Step. A particularly useful option is "Retry this item". The Retry option removes the error response and re-executes the item on which Retry is set one time before registering the error. For example, you can set a Retry on a Step and if any item fails inside the Step then Badboy will clear the error and try the Step again. If there is no error on the second try then the script will continue without reporting any problem. However if the item fails again on the second execution then Badboy registers the error. This can help you prevent transient or temporary problems from causing your tests to fail in situations where Badboy is running on unreliable networks or is subject to other occasional problems.
When you configure handling for errors or timeouts, you have the option to control what action is taken when the timeout occurs. These include:
| Timeout Actions | Description |
| Continue from same position | Aborts the currently playing item and continues with the next item. |
| Abort this Step | Aborts the currently playing Step and continues with the item following that Step in the script. |
| Abort Hierarchy | Aborts the whole hierarchy of Steps right to the top level. Continues from the next item in the script following the top level Step containing the item that timed out. |
| Stop Playing | Stops the play sequence altogether. Badboy will stop and wait for manual intervention. |
| Repeat Containing Step | Rewinds back to the Step containing the item that timed out and plays the Step again. Note that any loop counters will be reset so that the Step will re-execute its looping behavior as well. |
| Retry this item | Discards any error response in the item and replays it one time only. If playback fails a second time, record the error and continue playing. |