Thursday, May 4, 2023

Whats the use of web_set_rts_key function in load runner | Overwrite HTTP erros in load runner

web_set_rts_key("key=HttpErrorsAsWarnings","Value=1",LAST);
web_set_rts_key("key=HttpErrorsAsWarnings","Value=0",LAST);

The `web_set_rts_key` function in LoadRunner is used to set custom key-value pairs in the Run-Time Settings (RTS). The RTS contains various settings that control how a script behaves during replay, including settings related to logging, timeouts, and error handling.

The `web_set_rts_key` function allows you to customize the RTS by setting custom key-value pairs. One common use of this function is to set the `HttpErrorsAsWarnings` key to a value of `1`. This tells LoadRunner to treat HTTP errors (such as 404 Not Found errors) as warnings rather than errors. When a HTTP error is treated as a warning, LoadRunner continues replaying the script instead of stopping the replay. The `web_set_rts_key("key=HttpErrorsAsWarnings","Value=1",LAST)` function is used to set a custom key-value pair in the RTS that tells LoadRunner to treat HTTP errors as warnings during replay. This can be useful in certain situations where you want the script to continue running even if it encounters HTTP errors.

If you use web_set_rts_key("key=HttpErrorsAsWarnings","Value=0",LAST); the `HttpErrorsAsWarnings` key is set to a value of 0. This key controls whether HTTP errors are treated as warnings or errors. When `HttpErrorsAsWarnings` is set to 1, HTTP errors are treated as warnings, and the Vuser continues executing the script. When it is set to 0, HTTP errors are treated as errors, and the Vuser stops executing the script and fails the transaction.

 `web_set_rts_key("key=HttpErrorsAsWarnings","Value=0",LAST)` is used to set the `HttpErrorsAsWarnings` key to 0, which makes HTTP errors treated as actual errors in the LoadRunner/VuGen performance testing script.