51Testing软件测试论坛
标题:
问个很简单的问题
[打印本页]
作者:
newerT
时间:
2011-8-3 13:53
标题:
问个很简单的问题
char *v, *v2, *v3;
v = lr_eval_string("REQUESTDS");
v2 = GetMd5FromString(v);
web_submit_data("reservations.pl_8",
"Action=http://localhost:1080/WebTours/reservations.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost:1080/WebTours/reservations.pl",
"Snapshot=t48.inf",
"Mode=HTTP",
ITEMDATA,
"Name=firstName", "Value=1", ENDITEM,
"Name=lastName", v2, ENDITEM, //这里本来是"Name=lastName", "Value=123", ENDITEM,
"Name=address1", "Value=234 Willow Drive", ENDITEM,
"Name=address2", "Value=San Jose/CA/94085", ENDITEM,
"Name=pass1", "Value=Joseph Marshall", ENDITEM,
"Name=creditCard", "Value=12345678", ENDITEM,
"Name=expDate", "Value=07/10", ENDITEM,
"Name=oldCCOption", "Value=", ENDITEM,
"Name=numPassengers", "Value=1", ENDITEM,
"Name=seatType", "Value=Coach", ENDITEM,
"Name=seatPref", "Value=Aisle", ENDITEM,
"Name=outboundFlight", "Value=041;312;08/02/2011", ENDITEM,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=returnFlight", "Value=", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=.cgifields", "Value=saveCC", ENDITEM,
"Name=buyFlights.x", "Value=17", ENDITEM,
"Name=buyFlights.y", "Value=7", ENDITEM,
LAST);
想问下这样改为什么不行,运行后报错,而且出现乱码:
Action.c(488): Error -27225: The "?r?r#<r?r?r#<r?ry1r#<ri1rZ1r#<rM1rA1r#<r01r)1r#<r?r?r#<r?r?r#<r?r?r#<r?r?r#<rn4rf4r#<r1r)1r#<r?r?r#<r?r
1r#<r?r?r#<r?rH2r#<r$ArUUUU???" argument (number 13) is not recognized within "ITEMDATA" [MsgId: MERR-27225]
Action.c(488): web_submit_data("reservations.pl_7") highest severity level was "ERROR", 0 body bytes, 0 header bytes [MsgId: MMSG-26388]
作者:
wsbuaa
时间:
2011-8-3 15:24
为什么要这么做呢?
直接把v2用lr_save_string保存为一个参数
然后在web_submit_data的相应位置使用这个参数不就完了?
作者:
newerT
时间:
2011-8-3 15:51
回复
2#
wsbuaa
我这样试了还是不行
char *v, *v2, *v3;
v2 = GetMd5FromString("a");
v3 = lr_eval_string(v2);
lr_output_message(v3);
web_submit_data("Standard.aspx",
"Action=http://www.glbpay.com:81/gateway/Payment/Standard.aspx",
"Method=POST",
"RecContentType=text/html",
//"Referer=",
"Snapshot=t3.inf",
"Mode=HTTP",
ITEMDATA,
。。。。。。
"Name=REQUESTDS", v3, ENDITEM,
。。。。。。
LAST);
Action.c(11): 0cc175b9c0f1b6a831c399e269772661
Action.c(17): Error -27225: The "0cc175b9c0f1b6a831c399e269772661" argument (number 36) is not recognized within "ITEMDATA" [MsgId: MERR-27225]
Action.c(17): web_submit_data("Standard.aspx") highest severity level was "ERROR", 0 body bytes, 0 header bytes [MsgId: MMSG-26388]
作者:
wsbuaa
时间:
2011-8-3 16:36
本帖最后由 wsbuaa 于 2011-8-3 16:44 编辑
http://bbs.51testing.com/thread-489038-1-2.html
这也是你提的吧,看看我的回答
我没明白你用lr_eval_string搞什么?
你那种方法我还真没试过,不过光看v2的内容也知道不可能对
因为v2中根本没有包含 Value= 这一段
作者:
newerT
时间:
2011-8-3 16:44
回复
4#
wsbuaa
原来是这样,因为我原本用lr_save_string的时候报错,然后我想直接把值提出来在赋值算了,谢谢啊
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2