ps:如果你觉得对你有帮助的话,麻烦点个赞,加个关注,就算对我整理教程,码字的鼓励,谢谢大家
简介: 步骤: 脚本: 简介:Loadrunner制作webtour注册用户参数化脚本,可以实现自动注册新用户
步骤: 【1】新建web脚本,打开webtour的服务
【2】把脚本复制到新建脚本中,创建new parameter(新的参数),
【3】再设置参数化属性(Parameter Properties)
【4】设置运行逻辑(Run Logic),连续3次运行脚本,再ctrl+s保存设置
【5】两个都是三种方式,3*3=9,最多有9种组合方式,你可以每种都试一下,有些可能会报错,属于正常现象,因为重复录制同个用户名,所以报错。
【6】补充,如果你真的想重复录制同个用户名,你可以删除掉之前录制的用户名
Action()
{
web_url("WebTours",
"URL=http://127.0.0.1:1080/WebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t20.inf",
"Mode=HTML",
LAST);
lr_think_time(6);
web_link("sign up now",
"Text=sign up now",
"Snapshot=t21.inf",
EXTRARES,
"Url=http://config.pinyin.sogou.com/api/toolbox/geturl.php?h=6E74D6CA41203B7E0E0331BD4318EF4A&v=9.5.0.3399&r=0000_sogou_pinyin_95a", "Referer=", ENDITEM,
LAST);
lr_think_time(14);
web_submit_form("login.pl",
"Snapshot=t22.inf",
ITEMDATA,
"Name=username", "Value=user1", ENDITEM,
"Name=password", "Value=1234", ENDITEM,
"Name=passwordConfirm", "Value=1234", ENDITEM,
"Name=firstName", "Value=liang", ENDITEM,
"Name=lastName", "Value=user", ENDITEM,
"Name=address1", "Value=", ENDITEM,
"Name=address2", "Value=", ENDITEM,
"Name=register.x", "Value=59", ENDITEM,
"Name=register.y", "Value=11", ENDITEM,
LAST);
web_image("button_next.gif",
"Src=/WebTours/images/button_next.gif",
"Snapshot=t23.inf",
LAST);
web_image("SignOff Button",
"Alt=SignOff Button",
"Snapshot=t24.inf",
LAST);
return 0;
}