Difference between revisions of "LoadRunner Correlation"

From PeformIQ Upgrade
Jump to navigation Jump to search
(New page: =Scraping Binary Data within LoadRunner Scripts= Using Winsocket... The left boundary is composed of 3F and DD. The right boundary is composed of CC and b. So: <pre> web_reg_save_param...)
 
Line 15: Line 15:


For whichever boundary, use BIN with LB and RB, then web_reg_save_param() can be used with binary data.
For whichever boundary, use BIN with LB and RB, then web_reg_save_param() can be used with binary data.
=Capture the Entire Page Body in HTML=
Tto capture the whole data from a body of server's response use the web_reg_save_param()function as follows:
<pre>
web_reg_save_param("body",
                  "LB=\r\n\r\n",
                  "RB=",
                  LAST);
</pre>
This function should be placed before the web_url() function which will return the data. After execution, the parameter, 'Body', will contain the body data.
I will clarify briefly the meaning of boundaries - "LB=\r\n\r\n" and "RB=".
Please, read the basic concepts of HTTP protocol, read Request message section:
A requirement of the HTTP protocol is that the header and body of a HTTP return be separated by an empty line (i.e. two (2) CRLF pairs)
The first CRLF (that is, a carriage return (CR = "\r") followed by a line feed (LF = "\n")) ends the last header line.  The second CRLF ("\r\n") creates empty line.  All data, followed by second CRLF, are the message body.
So to summarize, the specification ("LB=\r\n\r\n") means "start capturing from the beginning of message body".  The empty right boundary ("RB=") will be interpreted as "capture data till the end of message".
Note that server returns the length of file to be downloaded this can be used when using thios mechanism to download files.


=Catpuring Data from HTML Page Headers=
=Catpuring Data from HTML Page Headers=

Revision as of 14:18, 20 March 2008

Scraping Binary Data within LoadRunner Scripts

Using Winsocket...

The left boundary is composed of 3F and DD. The right boundary is composed of CC and b.

So:

web_reg_save_param("ParamName",
                   "LB/BIN=\\x3F\\xDD",
                   "RB/BIN=\\xCCb",
                   LAST);

For whichever boundary, use BIN with LB and RB, then web_reg_save_param() can be used with binary data.

Capture the Entire Page Body in HTML

Tto capture the whole data from a body of server's response use the web_reg_save_param()function as follows:


web_reg_save_param("body",
                   "LB=\r\n\r\n",
                   "RB=",
                   LAST);

This function should be placed before the web_url() function which will return the data. After execution, the parameter, 'Body', will contain the body data.

I will clarify briefly the meaning of boundaries - "LB=\r\n\r\n" and "RB=". Please, read the basic concepts of HTTP protocol, read Request message section:

A requirement of the HTTP protocol is that the header and body of a HTTP return be separated by an empty line (i.e. two (2) CRLF pairs)

The first CRLF (that is, a carriage return (CR = "\r") followed by a line feed (LF = "\n")) ends the last header line. The second CRLF ("\r\n") creates empty line. All data, followed by second CRLF, are the message body. So to summarize, the specification ("LB=\r\n\r\n") means "start capturing from the beginning of message body". The empty right boundary ("RB=") will be interpreted as "capture data till the end of message".

Note that server returns the length of file to be downloaded this can be used when using thios mechanism to download files.

Catpuring Data from HTML Page Headers