Loadrunner 的web_set_option()函数

我在测试中用到的:

 web_set_option("MaxRedirectionDepth", "0", LAST); 

后面的请求是一个302请求,为了截断这个302请求,让它只执行第一个请求,使用了这个函数,设置“MaxRedirectionDepth”为0,也就是URL最多重定向为1,达到了截断302请求的目的。

这个web_set_option()函数还有什么其他用法呢?

C Language:

int web_set_option( const char *OptionID, const char *OptionValue, LAST );

General Information

The web_set_option function sets a Web option. It is service function that affects all functions following it, until a new value is specified. When the vuser_init section finishes running, the current options values are saved. The values are restored to the saved values before the start of each iteration.

 

The following options are supported:

 

DecodeContent: Enables or disables decoding of server reply content when a "Content–Encoding" header is sent by the server. Currently it affects decompression(解压缩,还原) only. The available values are "Yes" and "No".

 

DownloadNonHtmlResources: Set to "Yes" to start or resume downloading non–HTML resources (for example, images) in a Web page during replay. Set to "No" to stop. This option gives you the opportunity to override the Browser Emulation option in the Vuser's Run–Time Settings, Download non–HTML Resources. This option can help when debugging. At certain points in the code you may want to stop downloading resources to save time.

 

LRW_OPT_DISPLAY_IMAGE_BODY: Set to "Yes" to display the response and request body for images. Set to "No" to restore the default behavior of not displaying the bodies.

 

IgnoreCookieExpiresAttribute: Set to "Yes" to ignore the "expires" attribute of all cookies. Set to "No" to restore the default behavior of not processing expired cookies.

MaxRedirectionDepth: The maximum redirection depth. This option has the same effect as specifying MaxRedirectionDepth in the default.cfg file of a script. The value of this option must be a character string representing a decimal number.

 

LRW_OPT_NON_GUI_FRAMES_SCHEME_JAVASCRIPT: In low level (HTML and URL) scripts, frames defined "<FRAME SRC=JAVASCRIPT..> can be ignored when calculating the relative frame ID by setting this option to "No". The default is "Yes". This option does not apply to GUI level scripts.

 

LRW_OPT_HTML_CHAR_REF_BACKWARD_COMPATIBILITY: This option is for expert users. There are two types of web functions: low–level (HTML and URL) and GUI level. Unicode and certain character combinations are treated differently at the two levels. By setting this option to LRW_OPT_VALUE_NO, you can force GUI level character handling. Set the option back to LRW_OPT_VALUE_YES after the calls for which you wish to force GUI level handling. The default is LRW_OPT_VALUE_YES.

 

This function is supported for all Web scripts, and for WAP scripts running in HTTP mode only. It is not supported for WAP scripts running in Wireless Session Protocol (WSP) replay mode. 

猜你喜欢

转载自leona-yang.iteye.com/blog/1733318