51Testing软件测试论坛

标题: LR录制脚本有什么问题? [打印本页]

作者: huangning    时间: 2007-6-28 16:42
标题: LR录制脚本有什么问题?
Step:
1 Use the Web(Http/Html) Protocol.
2 Use the Web Example "http://localhost:1080/mercuryWebTours/"
3 Code is below:
#include "web_api.h"


Action()
{
        web_url("mercuryWebTours",
                "URL=http://localhost:1080/mercuryWebTours/",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTML",
                LAST);

        lr_think_time( 4 );

        web_submit_form("login.pl",
                "Snapshot=t2.inf",
                ITEMDATA,
                "Name=username", "Value=jojo", ENDITEM,
                "Name=password", "Value=bean", ENDITEM,
                "Name=login.x", "Value=49", ENDITEM,
                "Name=login.y", "Value=11", ENDITEM,
                LAST);

        web_image("Search Flights Button",
                "Alt=Search Flights Button",
                "Snapshot=t3.inf",
                LAST);

        lr_think_time( 2 );

        web_submit_form("reservations.pl",
                "Snapshot=t4.inf",
                ITEMDATA,
                "Name=depart", "Value=London", ENDITEM,
                "Name=departDate", "Value=06/29/2007", ENDITEM,
                "Name=arrive", "Value={NewParam}", ENDITEM,
                "Name=returnDate", "Value=06/30/2007", ENDITEM,
                "Name=numPassengers", "Value=1", ENDITEM,
                "Name=roundtrip", "Value=<OFF>", ENDITEM,
                "Name=seatPref", "Value=None", ENDITEM,
                "Name=seatType", "Value=Coach", ENDITEM,
                "Name=findFlights.x", "Value=53", ENDITEM,
                "Name=findFlights.y", "Value=11", ENDITEM,
                LAST);

(48)        web_submit_form("reservations.pl_2",
                "Snapshot=t5.inf",
                ITEMDATA,
                "Name=outboundFlight", "Value=200;338;06/29/2007", ENDITEM,
                "Name=reserveFlights.x", "Value=55", ENDITEM,
                "Name=reserveFlights.y", "Value=12", ENDITEM,
                LAST);


        return 0;
}
4 Have the new NewParam and run 2 interation .The first one iteration is successful and the 2th iteration is failed.
5 The error is below:
Action.c(48): Error -27979: Requested form not found   [MsgId: MERR-27979]
Action.c(48): web_submit_form("reservations.pl_2") highest severity level was "ERROR", 0 body bytes, 0 header bytes   [MsgId: MMSG-26388]

6 When we annotate the sentence as /*"Name=outboundFlight", "Value=200;338;06/29/2007", ENDITEM,*/.All of the iteration is successful.

[ 本帖最后由 huangning 于 2007-6-28 17:25 编辑 ]
作者: huangning    时间: 2007-6-28 17:27
我是通过比对lr自带的例子,发现必须这样修改的。但是好几天过去了,我还是没有看明白,为什么必须这样修改,请大家指教!谢谢sdlkfj2
作者: huangning    时间: 2007-7-25 20:46
这应该是录制识别出来了一些不对的代码,需要手工修改的,最近几天重点看得别的方面的内容,还没有仔细研究这个问题出现的环境及条件,改天研究后,再总结一下.sdlkfj2




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