LoadRunner video - How to capture the whole Web page?

LoadRunner video - How to capture the whole Web page?

This LoadRunner video tutorial shows how to capture Web page.
Using this approach, you can get HTML source code of any Web page and then downloade it to a local file.

LoadRunner video - How to capture the whole Web page?


There is a final LR script for capturing and saving Web page:
int hFile;
char *szFileName = "c:\\page.html";

//Mark that we will capture the whole body of Web page
//Note: Mark that web_reg_save_param should be placed *before* web_url
web_reg_save_param("prmPage", "LB=", "RB=", "Search=Body", "RelFrameID=1", LAST);

web_url("labs.google.com", "URL=http://labs.google.com/", LAST);

//Web page has been captured, so print it out
lr_output_message("Page is: \r\n%s", lr_eval_string("{prmPage}"));

//Truncate to zero length or create file for writing.
if ((hFile = fopen(szFileName, "wb")) == NULL)
{
    lr_error_message("Cannot open %s", szFileName);
    return LR_FAIL;
}

//Write captured Web page to an output file
fprintf(hFile, "%s", lr_eval_string("{prmPage}"));

//Close the file pointer.

fclose(hFile);


Related articles:


Do you like this LoadRunner video tutorial? Would you like to receive them in the future?
If yes, please subscribe to this blog RSS feed or by Email. (How to subscribe? VIDEO guide)



3 comments:

sreevalli said...

what is the use of capturing the whole webpage.i want to know further?

Dmitry Motevich said...

You can capture the whole Web page to check that a server returns correct data (a page).
Or you can parsed this received page and extract required data.
Also, you can save this page to local disk for further processing, etc.

sunil said...

iam not getting sound....wat may be the problem..?