运用web_reg_save函数在执行时候的报错,帮忙求助啊
char regidPram; //保存取到的流水号char regidPramVal; //保存以"Value=流水号"取到的流水号
query()
{
web_submit_data("mobileCodeLevel.do_4",
"Action=http://172.16.5.232:6677/Omega/pages/mobile/mobileCodeLevel.do?doEvent=queryCodeLevelByQueryForm",
"Method=POST",
"Referer=http://172.16.5.232:6677/Omega/pages/mobile/codeLevelMain.jsp",
"Snapshot=t68.inf",
"Mode=HTTP",
ITEMDATA,
"Name=start", "Value=0", ENDITEM,
"Name=limit", "Value=20", ENDITEM,
"Name=qcName", "Value={levelname}", ENDITEM,
"Name=qcDescription", "Value=", ENDITEM,
LAST);
lr_think_time(2);
web_reg_save_param("regid",
"LB=1',id:'",
"RB=',descr",
"Ord=ALL",
"Search=Body",
"RelFrameId=1",
LAST);
return 0;
}
lr_message("regid:%s", lr_eval_string("{regid}") );
//打印出关联的参数regid的值。
sprintf( regidPram, "{regid_%s}",lr_eval_string("{regid_count}") );
//把取到流水号保存到regidPram里,具体形式为
sprintf( regidPramVal,"Value=%s",lr_eval_string(regidPram) );
//组合流水号和”Value=”并保存到regidPramVal变量中。
lr_message( "The value argument is : %s",regidPramVal );
//打印出字符串变量regidPramVal的值。
报错如下:
query.c (28): syntax error; found "regid:%s" expecting `)'
query.c (28): skipping "regid:%s" `,' `lr_eval_string' `(' "{regid}"
query.c (28): redeclaration of `lr_message' previously declared at C:\\Program Files\\Mercury Interactive\\Mercury LoadRunner\\include/lrun.h (496)
query.c (28): syntax error; found `)' expecting `;'
query.c (28): skipping `)'
query.c (30): expecting an identifier
query.c (30): syntax error; found "{regid_%s}" expecting `)'
query.c (30): skipping "{regid_%s}" `,' `lr_eval_string' `(' "{regid_count}"
query.c (30): extraneous old-style parameter list
query.c (30): syntax error; found `)' expecting `;'
query.c (30): skipping `)'
query.c (32): expecting an identifier
query.c (32): syntax error; found "Value=%s" expecting `)'
query.c (32): skipping "Value=%s" `,' `lr_eval_string' `(' `regidPram'
query.c (32): extraneous old-style parameter list
query.c (32): syntax error; found `)' expecting `;'
query.c (32): skipping `)'
query.c (34): syntax error; found "The value argument... expecting `)'
query.c (34): skipping "The value argument... `,' `regidPramVal'
c:\\documents and settings\\administrator\\local settings\\temp\\noname15\\\\combined_noname15.c (9): 19 errors, not writing pre_cci.ci
请各位大侠指教,很奇怪,这段代码一直用,之前一直很正常,这次的版本却出现这样的问题,郁闷啊!! 关联函数的位置有问题。
如果你要从web_submit_data("mobileCodeLevel.do_4", 的返回信息里取数据,应该把关联函数放在前面 原帖由 whyleave 于 2008-10-16 17:18 发表 http://bbs.51testing.com/images/common/back.gif
关联函数的位置有问题。
如果你要从web_submit_data("mobileCodeLevel.do_4", 的返回信息里取数据,应该把关联函数放在前面
位置我调整过,依然有问题啊 1个是位置的问题
还有为什么return 0在中间? 原帖由 hmilyjch 于 2008-10-17 08:58 发表 http://bbs.51testing.com/images/common/back.gif
1个是位置的问题
还有为什么return 0在中间? [/quote
哈哈哈,我后来也发现了这个问题,写错位置拉,呵呵 你的关联处理都写在脚本外面了。。。注意}
页:
[1]