loadrunner录制的脚本,一个请求重复两次

上一篇 / 下一篇  2017-11-07 18:20:30 / 个人分类:loadrunner问题

第一次在这发帖,居然复制错**tion。。。。

下面是我的录制的脚本的action,麻烦各位看看

[code]Action()
{
web_reg_find("Text=Web Tours", 
LAST);

web_url("WebTours", 
"URL=http://127.0.0.1:1080/WebTours/", 
"TargetFrame=", 
"Resource=0", 
"RecContentType=text/html", 
"Referer=", 
"Snapshot=t1.inf", 
"Mode=HTML", 
LAST);

web_reg_find("Text=Web Tours", 
LAST);

web_url("WebTours_2", 
"URL=http://127.0.0.1:1080/WebTours/", 
"TargetFrame=", 
"Resource=0", 
"RecContentType=text/html", 
"Referer=", 
"Snapshot=t2.inf", 
"Mode=HTML", 
EXTRARES, 
"Url=http://s.pc.qq.com/navigate/adc/adc_loader.js?v=20160326171611", ENDITEM, 
"Url=../favicon.ico", "Referer=", ENDITEM, 
"Url=http://s.pc.qq.com/navigate/adc/v4/engine_loader_v3.js", ENDITEM, 
"Url=http://s.pc.qq.com/navigate/adc/json2.js", ENDITEM, 
"Url=http://s.pc.qq.com/navigate/adc/jquery.min.js?ver=3", ENDITEM, 
"Url=http://c.gj.qq.com/fcgi-bin/microreport?gjguid=39080b6b66e7a8a741214065f5527f9d&type=10&reserve1=2&bid=1&rand=0.4063753676029985&refer=http%3A%2F%2F127.0.0.1%3A1080%2FWebTours%2F&reserve3=348832", ENDITEM, 
"Url=http://s.pc.qq.com/navigate/adc/velocity.js", ENDITEM, 
LAST);

web_url("microreport", 
"URL=http://c.gj.qq.com/fcgi-bin/microreport?gjguid=39080b6b66e7a8a741214065f5527f9d&type=10&reserve1=2&bid=1&rand=0.4063753676029985&refer=http%3A%2F%2F127.0.0.1%3A1080%2FWebTours%2F&reserve3=348832", 
"TargetFrame=", 
"Resource=0", 
"Referer=http://127.0.0.1:1080/WebTours/", 
"Mode=HTML", 
LAST);

web_reg_find("Text=Web Tours Admin Page", 
LAST);

lr_think_time(10);

web_url("admin.pl", 
"URL=http://127.0.0.1:1080/WebTours/admin.pl", 
"TargetFrame=", 
"Resource=0", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/home.html", 
"Snapshot=t3.inf", 
"Mode=HTML", 
LAST);

web_add_cookie("MSO=SID&1509502792&MSO_ServerErrorsProb&50&MSO_ServerLoadProb&50; DOMAIN=127.0.0.1");

web_reg_find("Text=Web Tours Admin Page", 
LAST);

web_url("admin.pl_2", 
"URL=http://127.0.0.1:1080/WebTours/admin.pl", 
"TargetFrame=", 
"Resource=0", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/home.html", 
"Snapshot=t4.inf", 
"Mode=HTML", 
LAST);

web_reg_find("Text=Web Tours", 
LAST);

web_url("Return to the Web Tours Homepage", 
"URL=http://127.0.0.1:1080/WebTours/welcome.pl", 
"TargetFrame=body", 
"Resource=0", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/admin.pl", 
"Snapshot=t5.inf", 
"Mode=HTML", 
LAST);

web_reg_find("Text=Web Tours", 
LAST);

web_url("Return to the Web Tours Homepage_2", 
"URL=http://127.0.0.1:1080/WebTours/welcome.pl", 
"TargetFrame=body", 
"Resource=0", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/admin.pl", 
"Snapshot=t6.inf", 
"Mode=HTML", 
LAST);

lr_start_transaction("login");

web_reg_find("Text=Web Tours", 
LAST);

lr_think_time(20);

web_submit_data("login.pl", 
"Action=http://127.0.0.1:1080/WebTours/login.pl", 
"Method=POST", 
"TargetFrame=body", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home", 
"Snapshot=t7.inf", 
"Mode=HTML", 
ITEMDATA, 
"Name=userSession", "Value=122276.451356825zciQfQtpQzzzzzzHDHHDHpfzQi", ENDITEM, 
"Name=username", "Value={name}", ENDITEM, 
"Name=password", "Value={password}", ENDITEM, 
"Name=JSFormSubmit", "Value=off", ENDITEM, 
"Name=login.x", "Value=16", ENDITEM, 
"Name=login.y", "Value=13", ENDITEM, 
LAST);

web_reg_find("Text=Web Tours", 
LAST);

web_submit_data("login.pl_2", 
"Action=http://127.0.0.1:1080/WebTours/login.pl", 
"Method=POST", 
"TargetFrame=", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home", 
"Snapshot=t8.inf", 
"Mode=HTML", 
ITEMDATA, 
"Name=userSession", "Value=122276.451356825zciQfQtpQzzzzzzHDHHDHpfzQi", ENDITEM, 
"Name=username", "Value={name}", ENDITEM, 
"Name=password", "Value={password}", ENDITEM, 
"Name=JSFormSubmit", "Value=off", ENDITEM, 
"Name=login.x", "Value=16", ENDITEM, 
"Name=login.y", "Value=13", ENDITEM, 
LAST);

lr_end_transaction("login",LR_AUTO);

web_reg_find("Text=Web Tours", 
LAST);

lr_think_time(28);

web_url("welcome.pl", 
"URL=http://127.0.0.1:1080/WebTours/welcome.pl?page=search", 
"TargetFrame=", 
"Resource=0", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home", 
"Snapshot=t9.inf", 
"Mode=HTML", 
LAST);

web_reg_find("Text=Web Tours", 
LAST);

web_url("welcome.pl_2", 
"URL=http://127.0.0.1:1080/WebTours/welcome.pl?page=search", 
"TargetFrame=", 
"Resource=0", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home", 
"Snapshot=t10.inf", 
"Mode=HTML", 
LAST);

web_reg_find("Text=Flight Selections", 
LAST);

web_url("reservations.pl", 
"URL=http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome", 
"TargetFrame=", 
"Resource=0", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/welcome.pl?page=search", 
"Snapshot=t11.inf", 
"Mode=HTML", 
LAST);

web_reg_find("Text=Flight Selections", 
LAST);

lr_think_time(38);

web_submit_data("reservations.pl_2", 
"Action=http://127.0.0.1:1080/WebTours/reservations.pl", 
"Method=POST", 
"TargetFrame=", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome", 
"Snapshot=t12.inf", 
"Mode=HTML", 
ITEMDATA, 
"Name=advanceDiscount", "Value=0", ENDITEM, 
"Name=depart", "Value=Denver", ENDITEM, 
"Name=departDate", "Value=11/02/2017", ENDITEM, 
"Name=arrive", "Value=London", ENDITEM, 
"Name=returnDate", "Value=11/03/2017", ENDITEM, 
"Name=numPassengers", "Value=1", ENDITEM, 
"Name=seatPref", "Value=None", ENDITEM, 
"Name=seatType", "Value=Coach", ENDITEM, 
"Name=.cgifields", "Value=roundtrip", ENDITEM, 
"Name=.cgifields", "Value=seatType", ENDITEM, 
"Name=.cgifields", "Value=seatPref", ENDITEM, 
"Name=findFlights.x", "Value=41", ENDITEM, 
"Name=findFlights.y", "Value=9", ENDITEM, 
LAST);

web_reg_find("Text=Flight Selections", 
LAST);

web_submit_data("reservations.pl_3", 
"Action=http://127.0.0.1:1080/WebTours/reservations.pl", 
"Method=POST", 
"TargetFrame=", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome", 
"Snapshot=t13.inf", 
"Mode=HTML", 
ITEMDATA, 
"Name=advanceDiscount", "Value=0", ENDITEM, 
"Name=depart", "Value=Denver", ENDITEM, 
"Name=departDate", "Value=11/02/2017", ENDITEM, 
"Name=arrive", "Value=London", ENDITEM, 
"Name=returnDate", "Value=11/03/2017", ENDITEM, 
"Name=numPassengers", "Value=1", ENDITEM, 
"Name=seatPref", "Value=None", ENDITEM, 
"Name=seatType", "Value=Coach", ENDITEM, 
"Name=.cgifields", "Value=roundtrip", ENDITEM, 
"Name=.cgifields", "Value=seatType", ENDITEM, 
"Name=.cgifields", "Value=seatPref", ENDITEM, 
"Name=findFlights.x", "Value=41", ENDITEM, 
"Name=findFlights.y", "Value=9", ENDITEM, 
LAST);

web_reg_find("Text=Flight Reservation", 
LAST);

lr_think_time(7);

web_submit_data("reservations.pl_4", 
"Action=http://127.0.0.1:1080/WebTours/reservations.pl", 
"Method=POST", 
"TargetFrame=", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl", 
"Snapshot=t14.inf", 
"Mode=HTML", 
ITEMDATA, 
"Name=outboundFlight", "Value=020;338;11/02/2017", ENDITEM, 
"Name=numPassengers", "Value=1", ENDITEM, 
"Name=advanceDiscount", "Value=0", ENDITEM, 
"Name=seatType", "Value=Coach", ENDITEM, 
"Name=seatPref", "Value=None", ENDITEM, 
"Name=reserveFlights.x", "Value=43", ENDITEM, 
"Name=reserveFlights.y", "Value=7", ENDITEM, 
LAST);

web_reg_find("Text=Flight Reservation", 
LAST);

web_submit_data("reservations.pl_5", 
"Action=http://127.0.0.1:1080/WebTours/reservations.pl", 
"Method=POST", 
"TargetFrame=", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl", 
"Snapshot=t15.inf", 
"Mode=HTML", 
ITEMDATA, 
"Name=outboundFlight", "Value=020;338;11/02/2017", ENDITEM, 
"Name=numPassengers", "Value=1", ENDITEM, 
"Name=advanceDiscount", "Value=0", ENDITEM, 
"Name=seatType", "Value=Coach", ENDITEM, 
"Name=seatPref", "Value=None", ENDITEM, 
"Name=reserveFlights.x", "Value=43", ENDITEM, 
"Name=reserveFlights.y", "Value=7", ENDITEM, 
LAST);

lr_start_transaction("buy");

web_reg_find("Text=Reservation Made!", 
LAST);

lr_think_time(47);

web_submit_data("reservations.pl_6", 
"Action=http://127.0.0.1:1080/WebTours/reservations.pl", 
"Method=POST", 
"TargetFrame=", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl", 
"Snapshot=t16.inf", 
"Mode=HTML", 
ITEMDATA, 
"Name=firstName", "Value=Joseph", ENDITEM, 
"Name=lastName", "Value=Marshall", ENDITEM, 
"Name=address1", "Value=234 Willow Drive", ENDITEM, 
"Name=address2", "Value=San Jose/CA/94085", ENDITEM, 
"Name=pass1", "Value=Joseph Marshall", ENDITEM, 
"Name=creditCard", "Value=1234567", ENDITEM, 
"Name=expDate", "Value=01/10", ENDITEM, 
"Name=oldCCOption", "Value=", ENDITEM, 
"Name=numPassengers", "Value=1", ENDITEM, 
"Name=seatType", "Value=Coach", ENDITEM, 
"Name=seatPref", "Value=None", ENDITEM, 
"Name=outboundFlight", "Value=020;338;11/02/2017", ENDITEM, 
"Name=advanceDiscount", "Value=0", ENDITEM, 
"Name=returnFlight", "Value=", ENDITEM, 
"Name=JSFormSubmit", "Value=off", ENDITEM, 
"Name=.cgifields", "Value=saveCC", ENDITEM, 
"Name=buyFlights.x", "Value=41", ENDITEM, 
"Name=buyFlights.y", "Value=13", ENDITEM, 
LAST);

web_reg_find("Text=Reservation Made!", 
LAST);

web_reg_find("Text=leaves Denver  for London", 
LAST);

web_submit_data("reservations.pl_7", 
"Action=http://127.0.0.1:1080/WebTours/reservations.pl", 
"Method=POST", 
"TargetFrame=", 
"RecContentType=text/html", 
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl", 
"Snapshot=t17.inf", 
"Mode=HTML", 
ITEMDATA, 
"Name=firstName", "Value=Joseph", ENDITEM, 
"Name=lastName", "Value=Marshall", ENDITEM, 
"Name=address1", "Value=234 Willow Drive", ENDITEM, 
"Name=address2", "Value=San Jose/CA/94085", ENDITEM, 
"Name=pass1", "Value=Joseph Marshall", ENDITEM, 
"Name=creditCard", "Value=1234567", ENDITEM, 
"Name=expDate", "Value=01/10", ENDITEM, 
"Name=oldCCOption", "Value=", ENDITEM, 
"Name=numPassengers", "Value=1", ENDITEM, 
"Name=seatType", "Value=Coach", ENDITEM, 
"Name=seatPref", "Value=None", ENDITEM, 
"Name=outboundFlight", "Value=020;338;11/02/2017", ENDITEM, 
"Name=advanceDiscount", "Value=0", ENDITEM, 
"Name=returnFlight", "Value=", ENDITEM, 
"Name=JSFormSubmit", "Value=off", ENDITEM, 
"Name=.cgifields", "Value=saveCC", ENDITEM, 
"Name=buyFlights.x", "Value=41", ENDITEM, 
"Name=buyFlights.y", "Value=13", ENDITEM, 
LAST);

lr_end_transaction("buy",LR_AUTO);

return 0;
}[/code]

TAG:

pioneer  of  living space.......... 引用 删除 丰卉者   /   2018-08-10 08:46:10
有个配置项去掉就可以了。
 

评分:0

我来说两句

我的栏目

日历

« 2024-04-20  
 123456
78910111213
14151617181920
21222324252627
282930    

我的存档

数据统计

  • 访问量: 3605
  • 日志数: 1
  • 建立时间: 2017-11-07
  • 更新时间: 2017-11-07

RSS订阅

Open Toolbar