LR的3种关联方式

LR为Web虚拟用户脚本提供了几种关联的机制。

 

VuGen provides several correlation mechanisms for Web Vuser scripts. The automatic method discussed in Web (HTTP/HTML) Correlation Rules detects dynamic values during recording and allows you to correlate them right away. If you disabled automatic correlation, or if the automatic method did not detect all of the differences, you can use VuGen's built-in correlation mechanism, described in this section, to find differences and correlate the values. You can also use this mechanism for scripts that were only partially correlated.

The correlation mechanism uses snapshots to track the results of script execution. Snapshots are graphical representations of Web pages.
VuGen captures snapshots of the Web pages during record and replay. You compare the recorded snapshot to any of the replay snapshots to determine which values you need to correlate to successfully run the script. For more information about Record and Replay snapshots, see Understanding Snapshots.

The Web correlation mechanism has a built-in comparison utility that allows you to view the text or binary differences between the snapshots. You can then correlate the differences one-by-one or all at once.

If VuGen's correlation mechanisms are insufficient, or for protocols that do not support these mechanisms, such as Wireless, use manual correlation. For more information, see Performing Manual Correlation.

 

1、自动关联 - 预关联(录制前设置关联规则)

To instruct VuGen to correlate your statements during recording, you set the Correlation recording options. You set these options after opening a Web Vuser script but before you begin recording the session.

 

2、自动关联 - 录制后关联(扫描关联)

Select Vuser > Scan for Correlations or click the Find Correlations button. VuGen scans the script for dynamic values that need to be correlated and displays them in the Correlation Results tab

 

3、手动关联(手工往脚本添加关联函数web_reg_save_param)

For Wireless Vusers and other Vuser scripts for which automatic correlation did not apply, VuGen also allows you to manually correlate your scripts. You manually correlate a script by adding the code correlation functions. The function that allows you to dynamically save data to a parameter is web_reg_save_param.

When you run the script, the web_reg_save_param function scans the subsequent HTML page that is accessed. You specify a left and/or right boundary and VuGen searches for text between those boundaries. When VuGen finds the text, it assigns it to a parameter.

The function's syntax is as follows:

int web_reg_save_param (const char *mpszParamName, <List of Attributes>, LAST);

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值