51Testing软件测试论坛
标题:
请大家进来帮忙,“ITEMDATA”错误报告MERR-27225,帮助查了好久(已解决)
[打印本页]
作者:
zealzpc
时间:
2008-5-21 18:13
标题:
请大家进来帮忙,“ITEMDATA”错误报告MERR-27225,帮助查了好久(已解决)
代码如下!!
Action()
{
char id[100],getid[50],data[50],getdata[50];
web_url("login.action",
"URL=http://192.168.1.250:8888/tudouadsales/login.action",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=images/logo.jpg", ENDITEM,
"Url=../favicon.ico", "Referer=", ENDITEM,
LAST);
lr_think_time(6);
web_submit_data("j_acegi_security_check",
"Action=http://192.168.1.250:8888/tudouadsales/j_acegi_security_check",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://192.168.1.250:8888/tudouadsales/login.action",
"Snapshot=t4.inf",
"Mode=HTML",
ITEMDATA,
"Name=j_username", "Value=admin", ENDITEM,
"Name=j_password", "Value=111111", ENDITEM,
"Name=Submit", "Value=鐧诲綍", ENDITEM,
EXTRARES,
"Url=js/calendar/skin/WdatePicker.css", "Referer=http://192.168.1.250:8888/tudouadsales/index.action;jsessionid=E696F149D28B51FA8B94C711090F4676", ENDITEM,
"Url=images/icon.gif", "Referer=http://192.168.1.250:8888/tudouadsales/index.action;jsessionid=E696F149D28B51FA8B94C711090F4676", ENDITEM,
LAST);
// 关联编号
web_reg_save_param("getid",
"LB=id=\"contract.code\" value=\"",
"RB=\" readonly=\"readonly\"",
"Search=Body",
LAST);
//关联日期
web_reg_save_param("getdata",
"LB=id=\"contract.contractCreateDate\" value=\"",
"RB=\" onfocus=",
"Search=Body",
LAST);
//新建合同页面
web_url("鏂板缓鍚堝悓",
"URL=http://192.168.1.250:8888/tudouadsales/plantable/contract!initCreate.action?menu=contract&submenu=addContract",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.1.250:8888/tudouadsales/index.action;jsessionid=E696F149D28B51FA8B94C711090F4676",
"Snapshot=t5.inf",
"Mode=HTML",
LAST);
strcpy(id,"\"Value=");
strcat(id,lr_eval_string("{getid}"));
strcat(id,"\"");
lr_output_message(id);
strcpy(data,"\"Value=");
strcat(data,lr_eval_string("{getdata}"));
strcat(data,"\"");
lr_output_message(data);
web_submit_data("contract!save.action",
"Action=http://192.168.1.250:8888/tudouadsales/plantable/contract!save.action",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://192.168.1.250:8888/tudouadsales/plantable/contract!initCreate.action?menu=contract&submenu=addContract",
"Snapshot=t8.inf",
"Mode=HTML",
ITEMDATA,
"Name=contract.code",
id
(关联替代的值)/*"Value=20080521040"*/(此处为原值), ENDITEM,
"Name=contract.name", "Value=1", ENDITEM,
"Name=adOwner.id", "Value=100009", ENDITEM,
"Name=adOwner.name", "Value=163", ENDITEM,
"Name=agent.id", "Value=", ENDITEM,
"Name=agent.name", "Value=", ENDITEM,
"Name=seller.id", "Value=52", ENDITEM,
"Name=seller.name", "Value=sales", ENDITEM,
"Name=seller.cityName", "Value=涓婃捣甯\x82", ENDITEM,
"Name=contract.contractCreateDate",
data
(关联替代的值)/*"Value=2008-05-21"*/(此处为原值), ENDITEM,
"Name=contract.contractNumber", "Value=", ENDITEM,
"Name=planDate", "Value=", ENDITEM,
"Name=planAmount", "Value=", ENDITEM,
"Name=remark", "Value=", ENDITEM,
LAST);
return 0;
}
日志如下
Action.c(56): Notify: Saving Parameter "getid = 20080521098"
Action.c(56): Notify: Saving Parameter "getdata = 2008-05-21"
Action.c(56): web_url("鏂板缓鍚堝悓") was successful, 16033 body bytes, 401 header bytes, 21 chunking overhead bytes [MsgId: MMSG-26385]
Action.c(68): Notify: Parameter Substitution: parameter "getid" = "20080521098"
Action.c(70): "Value=20080521098"
Action.c(73): Notify: Parameter Substitution: parameter "getdata" = "2008-05-21"
Action.c(75): "Value=2008-05-21"
Action.c(77): Error -27225: The ""Value=20080521098"" argument (number 11) is not recognized within "ITEMDATA" [MsgId: MERR-27225]
Action.c(77): web_submit_data("contract!save.action") highest severity level was "ERROR", 0 body bytes, 0 header bytes [MsgId: MMSG-26388]
(
[
本帖最后由 zealzpc 于 2008-5-21 18:48 编辑
]
作者:
zealzpc
时间:
2008-5-21 18:17
作者:
whyleave
时间:
2008-5-21 18:27
你关联的时候把日期存在变量getid里,怎么替换的时候变成用id替换了
作者:
whyleave
时间:
2008-5-21 18:39
..你前面为什么要做这么多字符串的拼接啊,直接把20080521040用getid替换不就可以了
作者:
zealzpc
时间:
2008-5-21 18:42
回复2楼
strcpy(id,"\"Value=");用这个函数替换的
作者:
zealzpc
时间:
2008-5-21 18:46
原帖由
whyleave
于 2008-5-21 18:39 发表
..你前面为什么要做这么多字符串的拼接啊,直接把20080521040用getid替换不就可以了
回复3楼
Action.c(56): Notify: Saving Parameter "getdata = 2008-05-21"是我打印出来看参数值getdata = 2008-05-21
注意代码中我写到"Value=2008-05-21"(此处为原值), 原值是Value=2008-05-21而不是getdata = 2008-05-21中的
2008-05-21
所以要通过函数把原值的样子拼出来
在老师提点下我搞定了已经。。大家注意我的错误提示
Action.c(75): "Value=2008-05-21"Action.c(77): Error -27225: The
""Value=20080521098""
argument (number 11) is not recognized within "ITEMDATA" [MsgId: MERR-27225]
原来我多拼了2个引号
哈哈。。。。
还是上课的时候没理解。封贴啦~~~下班正好
作者:
云层
时间:
2008-5-21 21:41
上次上课我也多拼了两个引号
作者:
lyscser
时间:
2008-5-21 22:12
好啊,多谢分享
[
本帖最后由 lyscser 于 2008-5-22 00:06 编辑
]
作者:
tina_zhang
时间:
2009-1-8 10:30
楼主,你是怎么修改的?我看你的代码中也没有多拼两个引号呀?
作者:
森林一木
时间:
2009-1-8 12:14
脚本调试的时候,别急着运行,先做一下编译,检查一下语法错误。
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2