LoadRunner技巧之自动关联
作者:网络转载 发布时间:[ 2013/3/14 11:34:34 ] 推荐标签:
自动关联
在录制脚本之后打开recording Options 窗口,点击correlation标签页。确保Enable correlation during recording 选项处于勾选状态。
在LoadRunner 自带WebTours为例设置关联,
访问WebTours首页,点击administration 链接,设置 Set LOGIN form's action tag to an error page.勾选更新。
录制WebTours登录与退出脚本:
Action()
{
web_url("WebTours",
"URL=http://127.0.0.1:2080/WebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_url("favicon.ico",
"URL=http://127.0.0.1:2080/favicon.ico",
"Resource=1",
"Referer=",
LAST);
web_submit_data("login.pl",
"Action=http://127.0.0.1:2080/WebTours/login.pl",
"Method=POST",
"Referer=http://127.0.0.1:2080/WebTours/nav.pl?in=home",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=110381.833940867fzHHHzfpfiDDDDDDDtAzzpfQDf", ENDITEM,
"Name=username", "Value=test", ENDITEM,
"Name=password", "Value=123456", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
LAST);
web_submit_data("login.pl_2",
"Action=http://127.0.0.1:2080/WebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://127.0.0.1:2080/WebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=110381.833940867fzHHHzfpfiDDDDDDDtAzzpfQDf", ENDITEM,
"Name=username", "Value=test", ENDITEM,
"Name=password", "Value=123456", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
"Name=login.x", "Value=52", ENDITEM,
"Name=login.y", "Value=1", ENDITEM,
LAST);
web_image("SignOff Button",
"Alt=SignOff Button",
"Snapshot=t3.inf",
LAST);
return 0;
}
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11