51Testing软件测试论坛
标题:
LR 关联的多个参数如何保持匹配
[打印本页]
作者:
tangxuelian
时间:
2016-8-10 15:31
标题:
LR 关联的多个参数如何保持匹配
我录制的一份销售下单的脚本,单号,商品名称,价格都关联取得参数,参数较多,(ˇˍˇ) 想~随机取一个,有什么办法可以随机取得单号又能让名称和价格和单号保持匹配的,哪位大神有没有什么办法?
web_set_max_html_param_len("999999");
web_reg_save_param("code",
"LB={\"ProductCode\":\"",
"RB=\",",
"Ord=all",
LAST);
web_reg_save_param("pname",
"LB=\"Fullname\":\"",
"RB=\",",
"Ord=all",
LAST);
web_reg_save_param("price",
"LB=\"SalePrice\":",
"RB=,",
"Ord=1",
LAST);
web_url("GetShelvesSkuList",
"URL=http://192.168.1.89:8100/site/Product/GetShelvesSkuList?CurPage=1&MarketingDealerOrgId={dealerid}&PageSize=10&ProductCode=",
"Resource=1",
"RecContentType=application/json",
"Referer=http://192.168.1.89:8100/ebiz/#/sale/neworder/dealer",
"Snapshot=t174.inf",
LAST);
//统计参数个数
count = atoi(lr_eval_string("code_count"));
name_count = atoi(lr_eval_string("pname_count"));
//加判断,如果没有取到参数,就返回,或给一个固定值
if(count =0){
return;
}
if(name_count =0){
return;
}
Value = lr_paramarr_random("code");
lr_save_string(Value,"str");
productname = lr_paramarr_random("pname");
lr_save_string(productname,"name");
我把单号随机取参数,但名称无法和它匹配
作者:
seagull1985
时间:
2016-8-10 16:13
不是可以单个参数有多个字段吗?数组的方式
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2