|
- 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返回的值只是表示这个功能有没有被执行? |
|