罗谦诚 发表于 2018-8-5 13:25:00

url-based关联到的数据无法被成功保存

利用loadrunner自带的WebTours以Url-Based的方式录脚步然后作关联,日志提示关联成功了,但是最终的结果却不对
脚本如下
Action()
{

        lr_think_time(13);

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

        web_concurrent_start(NULL);

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

        web_reg_save_param("depart",
                "LB=value=\"",
                "RB=\">",
                "Ord={cityid}",
                LAST);       

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



        web_concurrent_end(NULL);

        web_concurrent_start(NULL);

        web_url("in_flights.gif",
                "URL=http://127.0.0.1:1080/WebTours/images/in_flights.gif",
                "Resource=1",
                "RecContentType=image/gif",
                "Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights",
                "Snapshot=t32.inf",
                LAST);

        web_url("home.gif",
                "URL=http://127.0.0.1:1080/WebTours/images/home.gif",
                "Resource=1",
                "RecContentType=image/gif",
                "Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights",
                "Snapshot=t33.inf",
                LAST);

        web_concurrent_end(NULL);

        web_url("button_next.gif",
                "URL=http://127.0.0.1:1080/WebTours/images/button_next.gif",
                "Resource=1",
                "RecContentType=image/gif",
                "Referer=http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome",
                "Snapshot=t34.inf",
                LAST);


        lr_start_transaction("order");


        lr_think_time(8);

        web_reg_save_param("flightid",
                "LB=value=",
                "RB= checked",
                LAST);

        web_submit_data("reservations.pl_2",
                "Action=http://127.0.0.1:1080/WebTours/reservations.pl",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome",
                "Snapshot=t35.inf",
                "Mode=HTTP",
                ITEMDATA,
                "Name=advanceDiscount", "Value=0", ENDITEM,
                "Name=depart", "Value={depart}", ENDITEM,
                "Name=departDate", "Value=08/06/2018", ENDITEM,
                "Name=arrive", "Value=London", ENDITEM,
                "Name=returnDate", "Value=08/07/2018", ENDITEM,
                "Name=numPassengers", "Value=1", ENDITEM,
                "Name=seatPref", "Value=Window", ENDITEM,
                "Name=seatType", "Value=Business", ENDITEM,
                "Name=.cgifields", "Value=roundtrip", ENDITEM,
                "Name=.cgifields", "Value=seatType", ENDITEM,
                "Name=.cgifields", "Value=seatPref", ENDITEM,
                "Name=findFlights.x", "Value=45", ENDITEM,
                "Name=findFlights.y", "Value=7", ENDITEM,
                LAST);

        web_submit_data("reservations.pl_3",
                "Action=http://127.0.0.1:1080/WebTours/reservations.pl",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://127.0.0.1:1080/WebTours/reservations.pl",
                "Snapshot=t36.inf",
                "Mode=HTTP",
                ITEMDATA,
                "Name=outboundFlight", "Value={flightid}", ENDITEM,
                "Name=numPassengers", "Value=1", ENDITEM,
                "Name=advanceDiscount", "Value=0", ENDITEM,
                "Name=seatType", "Value=Business", ENDITEM,
                "Name=seatPref", "Value=Window", ENDITEM,
                "Name=reserveFlights.x", "Value=56", ENDITEM,
                "Name=reserveFlights.y", "Value=11", ENDITEM,
                LAST);

        lr_think_time(11);

        web_submit_data("reservations.pl_4",
                "Action=http://127.0.0.1:1080/WebTours/reservations.pl",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://127.0.0.1:1080/WebTours/reservations.pl",
                "Snapshot=t37.inf",
                "Mode=HTTP",
                ITEMDATA,
                "Name=firstName", "Value=newtest", ENDITEM,
                "Name=lastName", "Value=0001", ENDITEM,
                "Name=address1", "Value=shanghai", ENDITEM,
                "Name=address2", "Value=china", ENDITEM,
                "Name=pass1", "Value=newtest 0001", ENDITEM,
                "Name=creditCard", "Value=12345678", ENDITEM,
                "Name=expDate", "Value=19/08", ENDITEM,
                "Name=oldCCOption", "Value=", ENDITEM,
                "Name=numPassengers", "Value=1", ENDITEM,
                "Name=seatType", "Value=Business", ENDITEM,
                "Name=seatPref", "Value=Window", ENDITEM,
                "Name=outboundFlight", "Value=020;491;08/06/2018", ENDITEM,
                "Name=advanceDiscount", "Value=0", ENDITEM,
                "Name=returnFlight", "Value=", ENDITEM,
                "Name=JSFormSubmit", "Value=off", ENDITEM,
                "Name=.cgifields", "Value=saveCC", ENDITEM,
                "Name=buyFlights.x", "Value=19", ENDITEM,
                "Name=buyFlights.y", "Value=8", ENDITEM,
                LAST);

        web_url("bookanother.gif",
                "URL=http://127.0.0.1:1080/WebTours/images/bookanother.gif",
                "Resource=1",
                "RecContentType=image/gif",
                "Referer=http://127.0.0.1:1080/WebTours/reservations.pl",
                "Snapshot=t38.inf",
                LAST);

        lr_end_transaction("order",LR_AUTO);

        return 0;
}

罗谦诚 发表于 2018-8-5 13:28:14

以类似的操作用Html-based录制脚本就没有问题,真是头大

罗谦诚 发表于 2018-8-5 13:29:52

本帖最后由 罗谦诚 于 2018-8-5 13:31 编辑

C:\Users\Administrator\Desktop\1533446523(1).png
C:\Users\Administrator\Desktop\1533446534(1).png

libingyu135 发表于 2018-8-7 10:32:05

那直接用lr的脚本

qqq911 发表于 2018-8-7 10:48:31

自己手动关联,自动关联不准确

abcsell 发表于 2018-8-7 10:53:21

这个可以使用别的关联方式

jingzizx 发表于 2018-8-7 12:25:52

自己手动关联试过么
页: [1]
查看完整版本: url-based关联到的数据无法被成功保存