ps:创作不易,还望素质三连(点赞,关注,给好评)
【1】启动webtours
【2】准备好注册脚本,复制到Loadruner的新建项目中,省去录制注册的步骤
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(5);
web_url("login.pl",
"URL=http://127.0.0.1:1080/cgi-bin/login.pl?username=&password=&getInfo=true",
"Resource=0",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/home.html",
"Snapshot=t32.inf",
"Mode=HTML",
LAST);
lr_think_time(6);
web_submit_form("login.pl_2",
"Snapshot=t33.inf",
ITEMDATA,
"Name=username", "Value=chaser", ENDITEM,
"Name=password", "Value=123456", ENDITEM,
"Name=passwordConfirm", "Value=123456", ENDITEM,
"Name=firstName", "Value=", ENDITEM,
"Name=lastName", "Value=", ENDITEM,
"Name=address1", "Value=", ENDITEM,
"Name=address2", "Value=", ENDITEM,
"Name=register.x", "Value=63", ENDITEM,
"Name=register.y", "Value=7", ENDITEM,
LAST);
return 0;
}
【3】设置username和password参数化,这里只展示username参数化,password参数化操作一致
给参数化用户名起名
再选中一次,往参数化用户名填20个用户名数据
20个用户名
test1
test2
test3
test4
test5
test6
test7
test8
test9
test10
test11
test12
test13
test14
test15
test16
test17
test18
test19
test20
20个密码:
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
【4】设置事务检查点,往空白的地方右键 insert 插入
事务头
事务尾
【5】设置连续注册20次
【6】最后点击运行,成功注册20个用户和能看到用户注册响应时间