51Testing软件测试论坛

标题: LR11.0场景运行的错误 [打印本页]

作者: xiaoshi_2011    时间: 2013-6-27 16:51
标题: LR11.0场景运行的错误
系统是XP  SP3    ,浏览器是IE6,lr11.0,录制的是LR自带的订票系统,在场景里设置了10个虚拟用户,其他的默认,运行结束后没有报什么错,但是虚拟用户全部都荡了,求各位高手帮帮我吧!谢谢大家了,以下是录制的脚本(已参数化了10个登录名和密码,添加了集合点和事务)
DenglLu()
{

        //web_add_cookie("s_fid=0FB96953C14617FA-03D7529ADF6AC13E; DOMAIN=127.0.0.1");

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

        //lr_think_time(6);

        lr_rendezvous("JIHE");

        lr_start_transaction("denglu");

        web_submit_data("login.pl",
                "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=t2.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=userSession", "Value=111164.171405427fHViAAHpAzzzzzzHDtDAipAtct", ENDITEM,
                "Name=username", "Value={name}", ENDITEM,
                "Name=password", "Value={password}", ENDITEM,
                "Name=JSFormSubmit", "Value=on", ENDITEM,
                "Name=login.x", "Value=69", ENDITEM,
                "Name=login.y", "Value=4", ENDITEM,
                LAST);

        lr_end_transaction("denglu", LR_AUTO);

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

        //lr_think_time(6);

        web_submit_data("reservations.pl",
                "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=t4.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=advanceDiscount", "Value=0", ENDITEM,
                "Name=depart", "Value=Denver", ENDITEM,
                "Name=departDate", "Value=06/28/2013", ENDITEM,
                "Name=arrive", "Value=Los Angeles", ENDITEM,
                "Name=returnDate", "Value=06/29/2013", 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=62", ENDITEM,
                "Name=findFlights.y", "Value=6", ENDITEM,
                LAST);

        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",
                "Snapshot=t5.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=outboundFlight", "Value=030;251;06/28/2013", 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=35", ENDITEM,
                "Name=reserveFlights.y", "Value=11", ENDITEM,
                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",
                "Snapshot=t6.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=firstName", "Value=shi", ENDITEM,
                "Name=lastName", "Value=tou", ENDITEM,
                "Name=address1", "Value=shanghai", ENDITEM,
                "Name=address2", "Value=100804", ENDITEM,
                "Name=pass1", "Value=shi tou", ENDITEM,
                "Name=creditCard", "Value=", ENDITEM,
                "Name=expDate", "Value=", ENDITEM,
                "Name=oldCCOption", "Value=", ENDITEM,
                "Name=numPassengers", "Value=1", ENDITEM,
                "Name=seatType", "Value=Coach", ENDITEM,
                "Name=seatPref", "Value=None", ENDITEM,
                "Name=outboundFlight", "Value=030;251;06/28/2013", ENDITEM,
                "Name=advanceDiscount", "Value=0", ENDITEM,
                "Name=returnFlight", "Value=", ENDITEM,
                "Name=JSFormSubmit", "Value=off", ENDITEM,
                "Name=.cgifields", "Value=saveCC", ENDITEM,
                "Name=buyFlights.x", "Value=54", ENDITEM,
                "Name=buyFlights.y", "Value=9", ENDITEM,
                LAST);

        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=t7.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=Book Another.x", "Value=74", ENDITEM,
                "Name=Book Another.y", "Value=6", ENDITEM,
                LAST);

        web_url("SignOff Button",
                "URL=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=1",
                "TargetFrame=body",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights",
                "Snapshot=t8.inf",
                "Mode=HTML",
                LAST);

        return 0;
}

运行结束后的截图

[attach]85942[/attach]
这个是我的脚本、场景、analysis的附件
[attach]85943[/attach]
作者: 容我想想    时间: 2013-6-27 23:40
你的脚本中没有添加检查点,怎么能保证你的业务运行成功呢,难道脚本不报错就表示没问题?
根据你上面贴出来的这个脚本“Name=userSession”,介个貌似需要做关联,你在好好看看,先把脚本搞定了!
作者: xiaoshi_2011    时间: 2013-6-28 13:33
回复 2# 容我想想


    请问这个该怎么做关联?
作者: xiaoshi_2011    时间: 2013-6-28 15:04
回复 2# 容我想想

因为我录制的是LR自带的订票系统,这个关联设置没错吧?
[attach]85956[/attach]




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2