求教一个LR循环语句写法
我录制一个脚本用户“test”审核一般计划数据三条,(三条数据的billid为:308300、308301、308302)录制脚本为:
Action()
{
lr_start_transaction("计划审核");
lr_think_time(26);
web_url("loading.gif",
"URL=http://192.168.3.3:9950/images/actions/loading.gif",
"TargetFrame=",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://192.168.3.3:9950/plan/normalplan/audit/query.do?mainmenu=23000&submenu=23320",
"Snapshot=t9.inf",
LAST);
web_custom_request("auditAction.do",
"URL=http://192.168.3.3:9950/plan/normalplan/audit/auditAction.do",
"Method=POST",
"TargetFrame=",
"Resource=0",
"RecContentType=application/json",
"Referer=http://192.168.3.3:9950/plan/normalplan/audit/query.do?mainmenu=23000&submenu=23320",
"Snapshot=t10.inf",
"Mode=HTML",
"EncType=application/x-www-form-urlencoded; charset=UTF-8",
"Body=maindata=%5B%7B%22billid%22%3A%20%22{id}%22%2C%20%22auditOpinion%22%3A%20%22%E5%90%8C%E6%84%8F%22%2C%20%22lastupdatetime%22%3A%20%221331629477600%22%7D%2C%20%7B%22billid%22%3A%20%22308301%22%2C%20%22auditOpinion%22%3A%20%22%E5%90%8C%E6%84%8F%22%2C%20%22lastupdatetime%22%3A%20%221331629405590%22%7D%2C%20%7B%22billid%22%3A%20%22308300%22%2C%20%22auditOpinion%22%3A%20%22%E5%90%8C%E6%84%8F%22%2C%20%22lastupdatetime%22%3A%20%221331629135126%22%7D%5D&submenu=23320",
LAST);
web_submit_data("tabquery.do",
"Action=http://192.168.3.3:9950/plan/normalplan/audit/tabquery.do?&mainmenu=23000&submenu=23320",
"Method=POST",
"TargetFrame=",
"RecContentType=application/json",
"Referer=http://192.168.3.3:9950/plan/normalplan/audit/query.do?mainmenu=23000&submenu=23320#",
"Snapshot=t11.inf",
"Mode=HTML",
ITEMDATA,
"Name=tabcondition", "Value=waittask", ENDITEM,
"Name=hidden_bdgmanagedivision", "Value=", ENDITEM,
"Name=bdgmanagedivision_valuecode", "Value=", ENDITEM,
"Name=bdgmanagedivision", "Value=", ENDITEM,
"Name=hidden_bdgagency", "Value=", ENDITEM,
"Name=bdgagency_valuecode", "Value=", ENDITEM,
"Name=bdgagency", "Value=", ENDITEM,
"Name=hidden_wfstatus", "Value=", ENDITEM,
"Name=wfstatus_valuecode", "Value=", ENDITEM,
"Name=wfstatus", "Value=", ENDITEM,
"Name=hidden_month", "Value=", ENDITEM,
"Name=month_valuecode", "Value=", ENDITEM,
"Name=month", "Value=", ENDITEM,
"Name=hidden_paytype", "Value=", ENDITEM,
"Name=paytype_valuecode", "Value=", ENDITEM,
"Name=paytype", "Value=", ENDITEM,
"Name=hidden_expfunc", "Value=", ENDITEM,
"Name=expfunc_valuecode", "Value=", ENDITEM,
"Name=expfunc", "Value=", ENDITEM,
"Name=start_createtime", "Value=", ENDITEM,
"Name=end_createtime", "Value=", ENDITEM,
"Name=billcode", "Value=", ENDITEM,
"Name=hidden_billcode", "Value=", ENDITEM,
"Name=element13", "Value=", ENDITEM,
"Name=element04", "Value=", ENDITEM,
"Name=element22", "Value=", ENDITEM,
"Name=element23", "Value=", ENDITEM,
"Name=element27", "Value=", ENDITEM,
"Name=executemethod", "Value=", ENDITEM,
"Name=expbyincflag", "Value=", ENDITEM,
"Name=expeconormic", "Value=", ENDITEM,
"Name=fundsource", "Value=", ENDITEM,
"Name=fundtype", "Value=", ENDITEM,
"Name=incomeexpmanage", "Value=", ENDITEM,
"Name=mainbody", "Value=", ENDITEM,
"Name=prepaytag", "Value=", ENDITEM,
"Name=program", "Value=", ENDITEM,
"Name=programtype", "Value=", ENDITEM,
"Name=sourcetag", "Value=", ENDITEM,
"Name=text10", "Value=", ENDITEM,
"Name=element05", "Value=", ENDITEM,
"Name=element11", "Value=", ENDITEM,
"Name=element12", "Value=", ENDITEM,
"Name=element21", "Value=", ENDITEM,
"Name=element03", "Value=", ENDITEM,
"Name=element02", "Value=", ENDITEM,
"Name=element01", "Value=", ENDITEM,
"Name=departmentdivision", "Value=", ENDITEM,
"Name=businesstype", "Value=", ENDITEM,
"Name=bdgyear", "Value=", ENDITEM,
"Name=amt", "Value=", ENDITEM,
"Name=text2", "Value=", ENDITEM,
"Name=text3", "Value=", ENDITEM,
"Name=text5", "Value=", ENDITEM,
"Name=text8", "Value=", ENDITEM,
"Name=text9", "Value=", ENDITEM,
"Name=allflag", "Value=0", ENDITEM,
"Name=allflag", "Value=0", ENDITEM,
"Name=totalrows", "Value=8", ENDITEM,
"Name=totalrows", "Value=8", ENDITEM,
"Name=totalpages", "Value=1", ENDITEM,
"Name=totalpages", "Value=1", ENDITEM,
"Name=currpage", "Value=1", ENDITEM,
"Name=fromquery", "Value=yes", ENDITEM,
"Name=queryall", "Value=", ENDITEM,
"Name=selectedTabIndex", "Value=0", ENDITEM,
"Name=rows", "Value=50", ENDITEM,
LAST);
lr_end_transaction("计划审核",LR_AUTO);
return 0;
}
求教问题是:我想把脚本修改为用户一次可以同时审核30条数据,请问怎样修改脚本,谢谢 无人问津??? 这个好像不太好弄
你可以让test登陆10次,一次审核3个。 回复 1# wdlcoke
要同时并发审批三条数据,要设置并发,将你的billid作为数据参数,对id进行参数化,然后调节取舍为Unique只取一次(因为提交了就不能再提交了)至于参数如何设置自己查资料和尝试
另外,for循环的内容在LR的帮助中写得很清楚:
Action() {
char character_set[] = {'a', '5', '$', 'z'};
int i;
for( i=0; i<4; i++ )
lr_output_message("%c ", toupper(character_set));
return 0;
} 如果系统可以复选30条然后实现一次操作全部处理,那么这个问题只是一个post数据包的结构问题
如果是要一条条来做,你要先考虑做关联,然后对关联返回数组做遍历即可 循环语句和一次直接审核30条的响应时间差很多啊!
我认为循环语句会 影响性能 mark
觉得和自己的问题很像啊~~
页:
[1]