解决1个Vuser登录系统后,迭代1000次,每次迭代循环下14个代码的14笔单问题,代码如下:
Action()
{
char A[][13]={"000001","000002","000003","000004","000005","000006","000007","000008","000009","000010","000011","000012","000013","000014"};
int i;
for(i=0;i<13;i++)
{
lr_save_string(A[i],"Order_code");
web_submit_data("GetCodeMRSByCode",
"Action=http://{IP}/Market/GetCodeMRSByCode",
"Method=POST",
"RecContentType=application/json",
"Referer=http://{IP}/Home/MainForm/?b=1",
"Snapshot=t113.inf",
"Mode=HTTP",
ITEMDATA,
"Name=code", "Value={Order_code}", ENDITEM,
LAST);
web_submit_data("DoOrder",
"Action=http://{IP}/Market/DoOrder",
"Method=POST",
"RecContentType=application/json",
"Referer=http://{IP}/Home/MainForm/?b=1",
"Snapshot=t114.inf",
"Mode=HTTP",
ITEMDATA,
"Name=para1", "Value={Order_code}", ENDITEM,
"Name=para2", "Value=1", ENDITEM,
"Name=para3", "Value=10", ENDITEM,
"Name=para4", "Value=1", ENDITEM,
"Name=para5", "Value=22700", ENDITEM,
"Name=para6", "Value=0", ENDITEM,
"Name=para7", "Value=1", ENDITEM,
"Name=para8", "Value=", ENDITEM,
LAST);
}
return 0;
}
备注:解决此问题前,尝试过用LR内部循环解决(将代码参数化,并通过F4中Run设置Block内循环14次),但实践证明发现,此方法是失败的,不管在参数化设置中使用任何分配数据方法,都无法达到预期效果,于是只能小试牛刀,添加若干C代码,通过多次运行,证实可以达到预期效果。