如果修改多个字段,如何做参数化
录入一个修改用户资料的脚本,使用A用户登录进行修改,如果想实现多个用户同时登录并修改资料,用此脚本对登录用户名进行了参数化,但是修改资料的脚本写入的还都是原来A用户用户信息,这样的话,脚本中的修改资料的信息和用的非A用户的资料是不一样的,我查看log文件,显示出来参数化的几个用户都调用了,但是实际运行结果中只有一个用户修改成功,想知道是不是用户资料其他字段也都要做参数化才能实现对用户资料的修改。 如果使用A去录制脚本,写入文件的信息,理论上来说,是写了A的做参数化的时候,你参数化写入的信息了没?
如果还是有问题,建议贴(部分)脚本 那是肯定要参数化的,不过一般都用关联了 回复 1# nancychi2002
这个样具体问题具体分析,可以将修改资料的那部分脚本同样做参数化,但有时也可以做关联,都可以解决这个问题。关联虽然不好做,但是写出来后,会比参数化方便不少!
如果你后面修改的资料是根据用户名加载的,那么还是做参数化比较好,如果是根据别的字段加载的,那么关联会好一些 非常感谢大家的回答,我目前是修改的用户资料是根据登录用户名取出来的,那是不是修改资料这部分的所有字段信息都要做参数化,如果做参数化的话如何能设置参数化选项才能保证我从数据库中取出来每个字段的值都是能对应上的,如何设置参数化的选项呢,多谢多谢!
// Parameter {WCSParam_Diff2} created by Correlation Studio
web_reg_save_param( "WCSParam_Diff2", "LB= value=\"", "RB=\"", "Ord=1", "IgnoreRedirections=Yes", "Search=Body", "RelFrameId=1", LAST );
web_submit_data("declare_explor_md2.do",
"Action=http://10.67.1.38:7012/etrading/declare_explor_md2.do",
"Method=POST",
"RecContentType=text/html",
"Referer=http://10.67.1.38:7012/etrading/trade/declare_md2.jsp?fundcode=002021",
"Snapshot=t86.inf",
"Mode=HTTP",
ITEMDATA,
"Name=functionno", "Value=04", ENDITEM,
"Name=fundcode", "Value=002021", ENDITEM,
"Name=remitusTradeacco", "Value=", ENDITEM,
"Name=tradeaccoTmp", "Value=20000541271", ENDITEM,
"Name=capitalmodeTmp", "Value=F", ENDITEM,
"Name=bankidcard", "Value=416160192316856621", ENDITEM,
"Name=sharetype", "Value=A", ENDITEM,
"Name=moneySource", "Value=0", ENDITEM,
"Name=tradeaccoTmp2", "Value=20000004576", ENDITEM,
"Name=broker", "Value=", ENDITEM,
"Name=declaresum", "Value=1001", ENDITEM,
"Name=kkxz", "Value=", ENDITEM,
"Name=submit", "Value=?", ENDITEM,
"Name=reserved", "Value=", ENDITEM,
"Name=reserved2", "Value=", ENDITEM,
"Name=governor", "Value=", ENDITEM,
"Name=governorpassword", "Value=", ENDITEM,
"Name=balancecoin", "Value=156", ENDITEM,
"Name=trademethod", "Value=0", ENDITEM,
"Name=bankpassword", "Value=", ENDITEM,
"Name=serial", "Value=", ENDITEM,
"Name=broker", "Value=", ENDITEM,
"Name=discountrate", "Value=1", ENDITEM,
"Name=promotion", "Value=", ENDITEM,
"Name=partflag", "Value=", ENDITEM,
"Name=fixbusinflag", "Value=", ENDITEM,
"Name=returnflag", "Value=", ENDITEM,
"Name=delayday", "Value=", ENDITEM,
"Name=discountflag", "Value=", ENDITEM,
"Name=tradeacco", "Value=20000541271", ENDITEM,
"Name=serial", "Value=", ENDITEM,
"Name=capitalmode", "Value=F", ENDITEM,
"Name=remindInfoHTML", "Value=?? 0.8||", ENDITEM,
LAST);
lr_think_time(21);
lr_start_transaction("申购事务");
web_submit_data("declare.do",
"Action=http://10.67.1.38:7012/etrading/declare.do",
"Method=POST",
"RecContentType=text/html",
"Referer=http://10.67.1.38:7012/etrading/declare_explor_md2.do",
"Snapshot=t87.inf",
"Mode=HTTP",
ITEMDATA,
"Name=org.apache.struts.taglib.html.TOKEN", "Value={WCSParam_Diff2}", ENDITEM,
"Name=discountflag", "Value=", ENDITEM,
"Name=sharetype", "Value=A", ENDITEM,
"Name=capitalmodeTmp", "Value=F", ENDITEM,
"Name=tradeaccoTmp", "Value=20000541271", ENDITEM,
"Name=declaresum", "Value=1001", ENDITEM,
"Name=fixbusinflag", "Value=", ENDITEM,
"Name=trademethod", "Value=0", ENDITEM,
"Name=submit", "Value=?", ENDITEM,
"Name=tradeaccoTmp2", "Value=20000004576", ENDITEM,
"Name=moneySource", "Value=0", ENDITEM,
"Name=partflag", "Value=", ENDITEM,
"Name=functionno", "Value=04", ENDITEM,
"Name=returnflag", "Value=", ENDITEM,
"Name=fundcode", "Value=002021", ENDITEM,
"Name=reserved2", "Value=", ENDITEM,
"Name=bankpassword", "Value=", ENDITEM,
"Name=serial", "Value=", ENDITEM,
"Name=remindInfoHTML", "Value=?? 0.8||", ENDITEM,
"Name=governor", "Value=", ENDITEM,
"Name=promotion", "Value=", ENDITEM,
"Name=tradeacco", "Value=20000541271", ENDITEM,
"Name=broker", "Value=", ENDITEM,
"Name=remitusTradeacco", "Value=", ENDITEM,
"Name=balancecoin", "Value=156", ENDITEM,
"Name=bankidcard", "Value=416160192316856621", ENDITEM,
"Name=delayday", "Value=", ENDITEM,
"Name=governorpassword", "Value=", ENDITEM,
"Name=discountrate", "Value=1", ENDITEM,
"Name=capitalmode", "Value=F", ENDITEM,
"Name=kkxz", "Value=", ENDITEM,
"Name=reserved", "Value=", ENDITEM,
"Name=submit", "Value=?", ENDITEM,
"Name=detailcapitalmode", "Value=01", ENDITEM,
LAST); 上面附上了修改部分的脚本,其中sessionid进行了关联,另外大家都提到也可以做关联,我目前sessionid是脚本运行之后可以在自动关联中直接做关联,可是这些修改的字段在运行脚本后也不列在自动关联中,如何做这些字段的关联呢 贴一下你的用户策略,如果你是让每个线程都操作不同的用户,请选用uniq方式 策略参考附图 你好,楼上的问题,现在都解决了吧,能不能教我啊,我现在也遇到你这个问题。要参数化多个字段。 我想设置多个用户并发登录操作,可是设置了参数化,却在日志统计里面看到每个用户都执行了两遍,是什么原因啊。。。
页:
[1]