51Testing软件测试论坛
标题:
web_submit_data 在什么时候才会返回1呢?
[打印本页]
作者:
edisonlzk
时间:
2010-7-23 14:05
标题:
web_submit_data 在什么时候才会返回1呢?
Action()
{
double trans_time;
int status;
web_reg_save_param("LoginSession",
"LB=userSession value=",
"RB=>",
LAST);
web_url("WebTours",
"URL=http://192.168.1.17:1080/mercuryWebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t2.inf",
"Mode=HTML",
LAST);
lr_start_transaction("Login");
trans_time=lr_get_transaction_duration( "Login" );
web_reg_find("Search=Body",
"SaveCount=count",
"Text=Error",
LAST);
status=web_submit_data("login.pl",
"Action=http://192.168.1.17:1080/mercuryWebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.1.17:1080/mercuryWebTours/nav.pl?in=home",
"Snapshot=t4.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={LoginSession}", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=0", ENDITEM,
"Name=login.y", "Value=0", ENDITEM,
LAST);
if (status == 0)
{
if (atoi(lr_eval_string("{count}")) > 0)
{
lr_end_transaction("Login", LR_FAIL);
return(0);
}
else
{
lr_end_transaction("Login", LR_PASS);
}
}
else
{
lr_end_transaction("Login", LR_FAIL);
}
if (trans_time)
{
lr_output_message("Login事务耗时 %f 秒", trans_time);
}
else
{
lr_output_message("The duration cannot be determined.");
}
return 0;
}
复制代码
无论我怎么改,web_submit_data都是返回0,要在哪种情况下,web_submit_data才会返回1?
或者web_submit_data返回的值只是表示这个功能有没有被执行?
作者:
skyzhu
时间:
2010-7-23 17:02
就最后说的
web_submit_data 返回值没有什么作用
返回的HTTP状态可以用 web_get_int_property 获取
作者:
a598824322
时间:
2010-7-24 00:31
赞同楼上
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2