loadrunner自带订票系统,脚本运行没报错,但是没有成功订票;
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了loadrunner自带订票系统,脚本运行没报错,但是没有成功订票;相关的知识,希望对你有一定的参考价值。
参考技术A 你是用的LR自带的webtour吧,你录制的脚本是订票,回放不报错,那就是没有关联,你确定你关联了吗?要是你关联了再联系我,我帮你看看脚本追问已经关联了,可以打印出outboundFlight=020;338;03/09/2017
loadrunner自动订票脚本通用;loadrunner脚本参数化,设置检查点
1 Action() 2 { 3 4 web_reg_find("Text=Web Tours", 5 LAST); 6 7 8 9 web_reg_save_param("session", 10 "LB=<input type=hidden name=userSession value=", 11 "RB=>", 12 LAST); 13 14 15 16 web_url("web_url", 17 "URL=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true", 18 "TargetFrame=", 19 "Resource=0", 20 "Referer=", 21 LAST); 22 23 24 25 26 web_url("web_url", 27 "URL=http://127.0.0.1:1080/WebTours/nav.pl?in=home", 28 "TargetFrame=", 29 "Resource=0", 30 "Referer=", 31 LAST); 32 33 34 35 36 lr_start_transaction("denglu"); 37 38 39 40 lr_think_time(20); 41 42 43 44 45 46 lr_error_message(lr_eval_string("{session}")); 47 48 49 50 web_submit_data("login.pl", 51 "Action=http://127.0.0.1:1080/WebTours/login.pl", 52 "Method=POST", 53 "TargetFrame=", 54 "RecContentType=text/html", 55 "Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home", 56 "Snapshot=t3.inf", 57 "Mode=HTML", 58 ITEMDATA, 59 "Name=userSession", "Value={session}", ENDITEM, 60 "Name=username", "Value=jojo", ENDITEM, 61 "Name=password", "Value=bean", ENDITEM, 62 "Name=JSFormSubmit", "Value=off", ENDITEM, 63 "Name=login.x", "Value=29", ENDITEM, 64 "Name=login.y", "Value=5", ENDITEM, 65 LAST); 66 67 lr_end_transaction("denglu",LR_AUTO); 68 69 70 71 web_reg_find("Text=Web Tours", 72 LAST); 73 74 lr_think_time(21); 75 76 web_url("Search Flights Button", 77 "URL=http://127.0.0.1:1080/WebTours/welcome.pl?page=search", 78 "TargetFrame=body", 79 "Resource=0", 80 "RecContentType=text/html", 81 "Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home", 82 "Snapshot=t4.inf", 83 "Mode=HTML", 84 LAST); 85 86 web_reg_find("Text=Flight Selections", 87 LAST); 88 89 lr_think_time(19); 90 91 web_submit_data("reservations.pl", 92 "Action=http://127.0.0.1:1080/WebTours/reservations.pl", 93 "Method=POST", 94 "TargetFrame=", 95 "RecContentType=text/html", 96 "Referer=http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome", 97 "Snapshot=t5.inf", 98 "Mode=HTML", 99 ITEMDATA, 100 "Name=advanceDiscount", "Value=0", ENDITEM, 101 "Name=depart", "Value=London", ENDITEM, 102 "Name=departDate", "Value=07/15/2018", ENDITEM, 103 "Name=arrive", "Value=Los Angeles", ENDITEM, 104 "Name=returnDate", "Value=07/16/2018", ENDITEM, 105 "Name=numPassengers", "Value=1", ENDITEM, 106 "Name=seatPref", "Value=None", ENDITEM, 107 "Name=seatType", "Value=Coach", ENDITEM, 108 "Name=.cgifields", "Value=roundtrip", ENDITEM, 109 "Name=.cgifields", "Value=seatType", ENDITEM, 110 "Name=.cgifields", "Value=seatPref", ENDITEM, 111 "Name=findFlights.x", "Value=76", ENDITEM, 112 "Name=findFlights.y", "Value=9", ENDITEM, 113 LAST); 114 115 web_reg_find("Text=Flight Reservation", 116 LAST); 117 118 lr_think_time(5); 119 120 web_submit_data("reservations.pl_2", 121 "Action=http://127.0.0.1:1080/WebTours/reservations.pl", 122 "Method=POST", 123 "TargetFrame=", 124 "RecContentType=text/html", 125 "Referer=http://127.0.0.1:1080/WebTours/reservations.pl", 126 "Snapshot=t6.inf", 127 "Mode=HTML", 128 ITEMDATA, 129 "Name=outboundFlight", "Value=230;773;07/15/2018", ENDITEM, 130 "Name=numPassengers", "Value=1", ENDITEM, 131 "Name=advanceDiscount", "Value=0", ENDITEM, 132 "Name=seatType", "Value=Coach", ENDITEM, 133 "Name=seatPref", "Value=None", ENDITEM, 134 "Name=reserveFlights.x", "Value=70", ENDITEM, 135 "Name=reserveFlights.y", "Value=17", ENDITEM, 136 LAST); 137 138 lr_start_transaction("buy"); 139 140 web_reg_find("Text=Reservation Made!", 141 LAST); 142 143 web_reg_find("Text=leaves London for Los Angeles", 144 LAST); 145 146 lr_think_time(12); 147 148 web_submit_data("reservations.pl_3", 149 "Action=http://127.0.0.1:1080/WebTours/reservations.pl", 150 "Method=POST", 151 "TargetFrame=", 152 "RecContentType=text/html", 153 "Referer=http://127.0.0.1:1080/WebTours/reservations.pl", 154 "Snapshot=t7.inf", 155 "Mode=HTML", 156 ITEMDATA, 157 "Name=firstName", "Value=Joseph", ENDITEM, 158 "Name=lastName", "Value=Marshall", ENDITEM, 159 "Name=address1", "Value=234 Willow Drive", ENDITEM, 160 "Name=address2", "Value=San Jose/CA/94085", ENDITEM, 161 "Name=pass1", "Value=Joseph Marshall", ENDITEM, 162 "Name=creditCard", "Value=", ENDITEM, 163 "Name=expDate", "Value=", ENDITEM, 164 "Name=oldCCOption", "Value=", ENDITEM, 165 "Name=numPassengers", "Value=1", ENDITEM, 166 "Name=seatType", "Value=Coach", ENDITEM, 167 "Name=seatPref", "Value=None", ENDITEM, 168 "Name=outboundFlight", "Value=230;773;07/15/2018", ENDITEM, 169 "Name=advanceDiscount", "Value=0", ENDITEM, 170 "Name=returnFlight", "Value=", ENDITEM, 171 "Name=JSFormSubmit", "Value=off", ENDITEM, 172 "Name=.cgifields", "Value=saveCC", ENDITEM, 173 "Name=buyFlights.x", "Value=43", ENDITEM, 174 "Name=buyFlights.y", "Value=15", ENDITEM, 175 LAST); 176 177 lr_end_transaction("buy",LR_AUTO); 178 179 return 0; 180 }
以上是关于loadrunner自带订票系统,脚本运行没报错,但是没有成功订票;的主要内容,如果未能解决你的问题,请参考以下文章
loadrunner 进行压力测试时,提示我 初始化失败通信错误