html tool

2018年5月25日星期五

loadrunner - HTTP_INFO_DOWNLOAD_SIZE


https://blog.csdn.net/redmoon729/article/details/44936929

LoadRunner中的web_get_in_property函数可用于返回上一个HTTP请求的相关信息,包括HTTP请求返回码、下载大小、下载时间等:
The web_get_int_property function returns specific information about the previous HTTP request.
The meaning of the return value depends on the HttpInfoType argument. HttpInfoType can be any of the following options. The first constant in each pair (HTTP_*) is for C, the second (object.HTTP_*) is for object oriented languages.
HTTP_INFO_RETURN_CODE or object.HTTP_INFO_RETURN_CODE
The return code in HTTP response header.
HTTP_INFO_DOWNLOAD_SIZE or object.HTTP_INFO_DOWNLOAD_SIZE
The size (in bytes) of the last download, including the header, body, and communications overhead (for example, NTLM negotiation).
HTTP_INFO_DOWNLOAD_TIME or object.HTTP_INFO_DOWNLOAD_TIME
The time in (milliseconds) of the last download.
HTTP_INFO_TOTAL_REQUEST_STAT or object.HTTP_INFO_TOTAL_REQUEST_STAT
Returns the accumulated size of all headers and bodies since the first time web_get_int_property was issued with HTTP_INFO_TOTAL_REQUEST_STAT.
HTTP_INFO_TOTAL_RESPONSE_STAT or object.HTTP_INFO_TOTAL_RESPONSE_STAT
Returns the accumulated size, including header and body, of all responses since the first time web_get_int_property was issued with HTTP_INFO_TOTAL_RESPONSE_STAT
/* Code the web_get_int_property function after the request 

(such as web_url or web_link) which starts the download. 

*/ 


i = web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE); 

lr_output_message("The download size of the URL was: %d",i); 

if(i > 10000) 

{ 

lr_end_transaction("DownloadUrL", LR_PASS); 

} 

else 

{ 

lr_end_transaction("DownloadUrL", LR_FAIL); 

} 



没有评论:

发表评论