|
代码如下如示,我用LR自带例子录制时,却有两个地方有登录信息,那参数化用户密码时岂不是得两个地方都参数化???
奇怪的是有时候只有web_submit_data("login.pl",...),是没有login.pl_2的,但有时候却又有,晕
#include "web_api.h"
#include "lrw_custom_body.h"
vuser_init()
{
// [WCSPARAM WCSParam_Diff1 40 96136.3496962333tQtfAVDptiHfcQzHApAiAQcf] Parameter {WCSParam_Diff1} created by Correlation Studio
web_reg_save_param( "WCSParam_Diff1", "LB=userSession value=", "RB=>", "Ord=1", "Search=Body", "RelFrameId=1.2.1", LAST );
web_url("MercuryWebTours",
"URL=http://localhost:1080/MercuryWebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_think_time( 3 );
web_submit_data("login.pl",
"Action=http://localhost:1080/MercuryWebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost:1080/MercuryWebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={WCSParam_Diff1}", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
"Name=login.x", "Value=47", ENDITEM,
"Name=login.y", "Value=10", ENDITEM,
LAST);
web_submit_data("login.pl_2",
"Action=http://localhost:1080/MercuryWebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost:1080/MercuryWebTours/nav.pl?in=home",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={WCSParam_Diff1}", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
LAST);
web_url("nav.pl",
"URL=http://localhost:1080/MercuryWebTours/nav.pl?page=menu&in=home",
"Resource=0",
"RecContentType=text/html",
"Referer=http://localhost:1080/MercuryWebTours/login.pl",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
web_url("login.pl_3",
"URL=http://localhost:1080/MercuryWebTours/login.pl?intro=true",
"Resource=0",
"RecContentType=text/html",
"Referer=http://localhost:1080/MercuryWebTours/login.pl",
"Snapshot=t5.inf",
"Mode=HTML",
LAST);
return 0;
} |
|