我有一个已经运行良好的现有脚本很长一段时间,现在看来应用程序的流程已经改变。
现在应用程序显示一个部分填写的表格(填写的字段不可编辑),我需要填写缺失的值,单击继续,然后再次单击继续。
现在,loadrunner 不会记录/注册第一次单击继续按钮,而第二次单击实际上会提交表单。
我尝试了各种选项,包括使用 Web(单击和脚本)录制,但没有成功,尝试单击图像/链接(第一个继续),但没有成功。
现在我不确定下一步该怎么做,希望这里的专家能够提供帮助。
...代码....
test_Funds()
{
lr_start_transaction("Login_test");
web_add_cookie("cust_xl=en; DOMAIN={test_Funds_2_p_env}");
web_add_cookie("login_date=2011-12-02%2001%3A43%3A36; DOMAIN={test_Funds_2_p_env}");
web_reg_find("Text=\r\n"
"\t\t\r\n"
"\t\t\t\r\n"
"\t\t\t\r\n"
"\t\t\t\tTest\r\n"
"\t\t\t\r\n"
"\t\t\r\n"
"\t",
LAST);
web_url("{test_Funds_2_p_env}",
"URL=https://{test_Funds_2_p_env}/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
URLs....
LAST);
lr_think_time(5);
web_submit_data("login",
"Action=https://{test_Funds_2_p_env}/login",
"Method=POST",
"RecContentType=text/plain",
"Referer=https://{test_Funds_2_p_env}/",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=action", "Value=login_user", ENDITEM,
"Name=username", "Value={test_Funds_2_p_username}", ENDITEM,
"Name=password", "Value={test_Funds_2_p_password}", ENDITEM,
LAST);
lr_end_transaction("Login_test", LR_AUTO);
web_reg_find("Text=\r\n"
"\t\t\r\n"
"\t\t\t\r\n"
"\t\t\t\r\n"
"\t\t\t\ttest\r\n"
"\t\t\t\r\n"
"\t\t\r\n"
"\t",
LAST);
web_add_cookie("login_date=2011-12-02%2001%3A47%3A43; DOMAIN={test_Funds_2_p_env}");
web_url("{test_Funds_2_p_env}_2",
"URL=https://{test_Funds_2_p_env}/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t3.inf",
"Mode=HTML",
EXTRARES,
urls...
LAST);
web_reg_find("Text=Text",
LAST);
lr_think_time(10);
web_reg_save_param_ex(
"ParamName=p_uniqueid",
"LB=\"unique_id\" value=\"",
"RB=\">",
SEARCH_FILTERS,
LAST);
web_reg_save_param_ex(
"ParamName=p_uid",
"LB='uid', ",
"RB=)",
SEARCH_FILTERS,
LAST);
lr_think_time(10);
web_reg_save_param_ex(
"ParamName=cpm_id",
"LB=\"cpm_id\" value=\"",
"RB=\"",
SEARCH_FILTERS,
LAST);
lr_start_transaction("Clicking on Open link");
web_link("Open",
"Text=Open",
"Snapshot=t4.inf",
EXTRARES,
urls....
LAST);
web_reg_find("Text=test",
LAST);
lr_end_transaction("Clicking on Open link", LR_AUTO);
lr_start_transaction("Form_Submit");
web_submit_data("portal",
"Action=https://{test_Funds_2_p_env}/test",
"Method=POST",
"RecContentType=text/html",
"Referer=https://{test_Funds_2_p_env}/test?action=GoOpenChoose",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
"Name=txn_type", "Value=TWIN", ENDITEM,
"Name=txn_type_source", "Value=", ENDITEM,
"Name=cpm_id", "Value={cpm_id}", ENDITEM,
"Name=cpm", "Value=test", ENDITEM,
"Name=unique_id", "Value={p_uniqueid}", ENDITEM,
"Name=vals_changed", "Value=1", ENDITEM,
"Name=wtd_amount", "Value={test_Funds_2_p_wtd_amt}", ENDITEM,
"Name=transit_no", "Value={test_Funds_2_p_transit_no}", ENDITEM,
"Name=institution_no", "Value={test_Funds_2_p_inst_no}", ENDITEM,
"Name=account_no", "Value={test_Funds_2_p_acct_no}", ENDITEM,
"Name=confirm_account_no", "Value={test_Funds_2_p_confirm_acct_no}", ENDITEM,
"Name=amount", "Value={test_Funds_2_p_wtd_amt}", ENDITEM,
"Name=password", "Value={test_Funds_2_p_password}", ENDITEM,
"Name=action", "Value=Dotest", ENDITEM,
"Name=uid", "Value={p_uid}", ENDITEM,
EXTRARES,
urls....
LAST);
lr_end_transaction("Form_Submit", LR_AUTO);
lr_free_parameter("p_uniqueid");
lr_free_parameter("p_uid");
lr_think_time(10);
lr_start_transaction("Logout_User");
web_link("FRANÇAIS",
"Text=FRANÇAIS",
"Snapshot=t6.inf",
EXTRARES,
URLs...
LAST);
lr_end_transaction("Logout_test", LR_AUTO);
返回0;}