|
代码如下!!
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 编辑 ] |
|