How do I customize how errors are reported during replay?
Silk Performer allows you to customize the severity of errors reported during a LoadTest. Depending on the severity, Silk Performer may record the errors and terminate either the current transaction or the entire simulation.
The severity may be any of the following values:
|SEVERITY_SUCCESS||The problem is ignored|
|SEVERITY_INFORMATIONAL||The problem is ignored, but reported as an informational message|
|SEVERITY_WARNING||The problem is ignored, but causes a warning|
|SEVERITY_ERROR||The problem is treated as an error|
|SEVERITY_TRANS_EXIT||The problem is treated as an error, the active transaction is aborted|
|SEVERITY_PROCESS_EXIT||The problem is treated as an error, the simulation is aborted.|
By default, severity level 'Success' is not recorded in the repository and all other levels are.
You can customize error severity in 2 ways:
- In the Active Profile settings under ACTIVE PROFILE | SIMULATION | ERRORS tab
- Using the 'ErrorAdd' function in the script.
For example, to reduce the severity of a 'HTTP 404 File not Found' Error to Warning:
Via the GUI:
- Go to ACTIVE PROFILE | SIMULATION | ERRORS
- Click the Add button
- Select the Module Silk Performer - HTTP
- Highlight "404 Object not found"
- Set the custom severity to Warning
- Click OK
In the script:
ErrorAdd(FACILITY_HTTP, 404, SEVERITY_WARNING);
NOTE: before you change the severity of an error, you should consider the implications carefully. Errors are reported for very good reasons, and reducing a "severity" to a "warning" could have severe consequences in a test environment. The temptation to "hide" errors via this type customization must always be avoided.