LoadRunner checks Previous HTTP request i.e. (HTTP 200

 Whenever server responds to the clients request then with the response code it sends HTTP 200 i.e.

The request was fulfilled.

Suppose we want to check the status of the returncode from  the server

int web_get_int_property ( const int HttpInfoType );

The above syntax returns specific information about previous HTTP request.

1. The meaning of the return value depends on the HttpInfoType argument.

2.HttpInfoType can be of any options like Returncode,Download Size,Download time.

How to use this function ::

Action()
{
int HttpRetCode;
lr_start_transaction(“Load_File”);

web_reg_find(“Text=My Workplace”,
LAST);

web_url(“LoadFile.jsp”,
“URL=http://servername/Workplace/LoadFile.jsp”,
“Resource=0”,
“RecContentType=text/html”,
“Referer=”,
“Snapshot=t1.inf”,
“Mode=HTML”,
LAST);

HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);

if (HttpRetCode == 200)

lr_log_message(“The script successfully accessed the Load page”);

else

lr_log_message(“The script failed to access the Load page “);

lr_end_transaction(“Load_File”,LR_AUTO);

return 0;
}

output :: You will find the desired output at the Replay log pane on the vugen

No comments:

Post a Comment