|
做个检查点就知道是否成功了,或者查看response,返回值是什么就知道了,再或者输出一个返回值看看
int i=0;
i=web_submit_data("login.pl",
"Action=http://127.0.0.1:2080/mercuryWebTours/login.pl",
"Method=POST",
"TargetFrame=body",
"RecContentType=text/html",
"Referer=http://127.0.0.1:2080/mercuryWebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={WCSParam_Diff1}", ENDITEM,
"Name=username", "Value={username}", ENDITEM,
"Name=password", "Value=tester1", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=17", ENDITEM,
"Name=login.y", "Value=4", ENDITEM,
LAST);
lr_output_message("===返回值:%d==",i);
如果i=0表示成功,i=1则表示失败了
再或者:
int httpcode=0;
web_submit_data("login.pl",
"Action=http://127.0.0.1:2080/mercuryWebTours/login.pl",
"Method=POST",
"TargetFrame=body",
"RecContentType=text/html",
"Referer=http://127.0.0.1:2080/mercuryWebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={WCSParam_Diff1}", ENDITEM,
"Name=username", "Value={username}", ENDITEM,
"Name=password", "Value=tester1", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=17", ENDITEM,
"Name=login.y", "Value=4", ENDITEM,
LAST);
httpCode = web_get_int_property(HTTP_INFO_RETURN_CODE); //紧随web_submit_data()函数后面,获取该函数的http返回值
lr_output_message("===httpcode返回值:%d==",httpCode );
如果返回200,则表示通过,返回其他的,可根据具体返回值的意思来判定。 |
|