`
leona_yang
  • 浏览: 8952 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

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. 

 

分享到:
评论

相关推荐

    LoadRunner中的Web 函数列表

    7. **Web_set_sockets_option()**:用于设置网络连接相关的选项,如超时时间、重试次数等,对网络环境的适应性有重要作用。 8. **Web_set_user()**:此函数用于设置虚拟用户的登录信息,如用户名和密码,它可以模拟...

    web test LoadRunner fuction_list

    在进行性能测试时,LoadRunner提供了强大的调试和日志功能,通过`web_set_log_options()`和`web_set_sockets_option()`等函数可以调整日志级别和内容,帮助找出脚本问题或性能瓶颈。 总的来说,理解并掌握...

    loadrunner函数

    web_set_option 此函数用于设置选项。 #### 39. web_set_sockets_option 此函数用于设置套接字选项。 以上列举的函数仅是LoadRunner中的一部分,但它们已经覆盖了大部分的测试需求。了解并熟练掌握这些函数的使用...

    loadrunnerWeb函数-4页.pdf

    在Web测试中,LoadRunner 提供了一系列的Web函数,这些函数允许测试人员模拟用户与Web应用程序的交互,以验证其稳定性和可扩展性。以下是部分重要的Web函数及其作用的详细解释: 1. **web_custom_request**:这个...

    loadrunnerWeb函数[收集].pdf

    27. **web_set_option** 和 **web_set_sockets_option**:这两函数允许你调整非HTML资源的编码、重定向和套接字选项,优化网络通信。 理解并熟练使用这些LoadRunner Web函数,将有助于构建更精确、更全面的性能测试...

    loadrunnerWeb函数[归类].pdf

    27. **web_set_option** 和 **web_set_sockets_option**:设置Web资源的编码、重定向和套接字选项,以优化测试行为和性能。 以上就是LoadRunner中的Web函数分类及其主要功能的详细解释,它们共同构成了LoadRunner...

    LoadRunner中的Web函数列表[文].pdf

    在LoadRunner中,Web函数是用于构建和控制Web虚拟用户脚本的关键元素。这些函数模拟真实的用户行为,如浏览网页、点击链接、提交表单等。以下是对这些函数的详细说明: 1. **操作函数**: - `web_custom_request`...

    Loadrunner函数汇总

    25. **web_report_data_point** 和 **web_set_option/web_set_sockets_option**: 分别用于指定数据报告点和设置Web或套接字选项,用于测试的监控和定制。 以上就是LoadRunner脚本中常见的函数及其功能,掌握这些...

    LoadRunner函数大全之中文解释

    8. **Web_set_sockets_option()**:设置网络套接字选项,如超时、重试次数等,以优化网络通信。 9. **TRumbaStep()**:TRunmbaStep系列函数用于与Tru64 Transaction Processing Monitor(TPM)环境交互。 10. **...

    loadrunner函数大全及中文解释(完整)

    4. **Web_set_sockets_option**:设置网络套接字选项,如超时时间、重试次数等。 5. **LR_start_transaction** 和 **LR_end_transaction**:用于开始和结束事务,以衡量特定业务流程的性能。 6. **Web_custom_...

    lr 函数大全之中文解释

    - `Web_set_sockets_option()`: 设置网络套接字选项,如超时时间、重试次数等。 - `Web_reg_save_param()`: 注册一个参数以捕获脚本运行时的动态数据。 - `Web_set_variable()`: 设置或修改变量的值。 - `Web_...

    Loadrunner负载测试 浏览器缓存设置

    在LoadRunner中,可以通过在HTTP协议初始化函数(http_init())中设置`web_set_sockets_option("HDR_RESERVE", "0")`来实现这一目标,这样将确保每次请求都发送完整的HTTP头,包括那些控制缓存的头。 2. **启用缓存...

    总结下LoadRunner 接收Mismatch问题的处理办法

    - 使用 `lrs_set_recv_timeout2(long sec, long u_sec)` 函数设置接收超时时间。 - 例如,如果希望将超时时间设置为 1 秒,可以调用 `lrs_set_recv_timeout2(1, 0)`。 #### 四、使用 `MSG_PEEK` 标志 `MSG_PEEK` ...

    LoadRunner Winsocket协议知识总结

    - **lrs_set_receive_option**:设置套接字接收选项。这些选项可能包括接收数据的缓冲区大小、超时设置等,可以帮助优化数据接收过程。 - **lrs_set_socket_handler**:为指定的套接字设置处理句柄。这样可以在...

    loadrunner经典面试题.txt

    在Loadrunner中,web事务是指用户与web应用的一次完整的交互过程。事务时间是指完成一次完整交互所需的时间,通常包括页面加载时间、数据处理时间等。事务时间是衡量web应用性能的重要指标之一。 ### 33. 图形与...

    使用LodRunner实现大负载测试的四部曲.pdf

    4. **脚本优化**:在脚本首行添加`web_set_sockets_option("SHUTDOWN_MODE","ABRUPT")`函数,强制改变关闭连接的方式,由默认的GRACEFUL模式改为ABRUPT模式,快速释放资源。 #### 第二部曲:LoadRunner配置优化 ...

Global site tag (gtag.js) - Google Analytics