大部分的人,只会录登录逻辑,直接上代码,代码如下:
Action()
{
lr_think_time(12);
//添加登录时的集合点Login
lr_rendezvous("login");
//设置开始事务
lr_start_transaction("login");
//获取验证码
web_url("code",
"URL=http://<url>/code.do",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
//登录
web_submit_data("login",
"Action=http://<url>/login.do",
"Method=POST",
"RecContentType=text/xml",
"Referer=http://<url>/index.do",
"Mode=HTML",
ITEMDATA,
"Name=inputcode", "Value=user1",ENDITEM,
"Name=loginname", "Value=user1",ENDITEM,
"Name=password", "Value=user1234",ENDITEM,
LAST);
//停5秒
lr_think_time(5);
//点击订单管理页面
web_url("order",
"URL=http://<url>/order/list.do",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
//设置结束事务
lr_end_transaction("login", LR_AUTO);
return 0;
}
其中<url>是变量,不同系统的参数有所不同。
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://blog.csdn.net/jlq_diligence/article/details/121767153
内容来源于网络,如有侵权,请联系作者删除!