Open topic with navigation
Sets a Web option.
web.setOption( optionId, optionValue );
The option whose value you want to set (case insensitive).
The value of the specified option (case insensitive),
The following argument(s) can be parameterized using standard parameterization: optionId, optionValue
The web.setOption 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 "
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_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
// Disable decoding web.setOption("DecodeContent","No"); // Enable decoding web.setOption("DecodeContent", "Yes"); // Disable redirection. If redirection is required in following action functions, a warning is issued. web.setOption("MaxRedirectionDepth", "0"); // Set the maximum redirection depth to 10. web.setOption("MaxRedirectionDepth", "10");