Thursday, October 10, 2019

Capture correlation value from response headers | CsrfToken Value Correlation

To capture the csrf token value in headers you need to do one thing prior to enhance the script.
  1. Go to Recording Options
  2. HTTP properties
  3. Advanced
  4. Headers and add 'csrf-token' or select 'Record header not in list'.Then record the script or regenerate the script.
Please note that the header name in web_add_header is without the colon (:) or space. The right boundary in web_reg_save_param function should be \r\n 

web_add_header("csrf-token","{CsrfToken}"");


In header server response the token value looks like this
x-csrf-token: 0FTwrefb89ijdhdhky0lkdkdkkrelw0rIw==

The final function should be as follows


web_reg_save_param("XCsrfToken","LB=x-csrf-token: ","RB=\r\n","Search=Headers",LAST);

Monday, October 7, 2019

Different type of LR messages in load runner | lr_message() lr_output_message() lr_log_message() lr_error_message() lr_set_debug_message() lr_vuser_status_message()

lr_message(): This is a message function that is used to send a message(s) to the log and the output window.

lr_output_message(): This is a message function that is used to send the message(s) with details like the script section and line number to output windows, log files and other test report summaries.

lr_log_message(): This is a message function that is used to send a message(s) to the Vuser or agent log file and not to the output window.

lr_error_message(): This is a message function that is used to send a message(s) to the output windows, log files and other test report summaries.

lr_set_debug_message(): This function changes the message logging level (for a part of the script) from what is set in the Run-Time settings. As shown below, a full trace is enabled only for the ‘index.htm’ request (even if the log level is set to ‘Standard log’ in Run-Time settings).

lr_vuser_status_message(): This function sends a message to the Vuser status area of the Controller and to the Vuser log.