jncc1234 发表于 2008-6-18 08:43:50

loadrunner录制的脚本无法执行问题--还请诸位高手多帮忙

最近作公司项目性能测试,分析部分功能的两种实现方式那种好,但是录好的脚本在执行的时候总是提示错误下面是录制的脚本,和错误提示信息,还请大家多帮忙。谢啦。
脚本:
#include "web_api.h"


Action()
{
        web_url("eimtest",
                "URL=http://172.20.19.134:8080/eimtest",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=/eimtest/images/index/index_08.gif", "Referer=http://172.20.19.134:8080/eimtest/", ENDITEM,
                LAST);

        lr_think_time( 22 );

        web_submit_form("loginAction.do",
                "Snapshot=t2.inf",
                ITEMDATA,
                "Name=subCompanyId", "Value=重庆市电力公司", ENDITEM,
                "Name=userName", "Value=csm", ENDITEM,
                "Name=password", "Value=cqepcsm", ENDITEM,
                LAST);
        lr_think_time( 22 );
        web_url("MarqContAction.do",                "URL=http://172.20.19.134:8080/eimtest/news/MarqContAction.do",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t3.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=../images/gnbj/left_02.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/gnbj/left_03.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/gnbj/left_04.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/gnbj/gnbj_02.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/gnbj/gnbj_05.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/top2_21.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/top2/top2_37.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/top2/top2_40.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/top/top_37.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/top/top_40.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/top2/top2_43.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/top/top_43.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/top/top_34.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/top/top_31.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/top2/top2_28.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                "Url=../images/top/top_28.gif", "Referer=http://172.20.19.134:8080/eimtest/mainpage.jsp", ENDITEM,
                LAST);

        lr_think_time( 1 );

        web_image("top_37.gif",
                "Src=images/top/top_37.gif",
                "Snapshot=t4.inf",
                EXTRARES,
                "Url=images/index/index_08.gif", ENDITEM,
                LAST);

        return 0;
}

从红字开始出现的错误,往下就没有执行过去。

下面是错误信息:
Action.c(27): Error -26627: HTTP Status-Code=404 (/eimtest/topic/a.html) for "http://172.20.19.134:8080/eimtest/topic/a.html"       
Action.c(27): Error -26627: HTTP Status-Code=404 (/eimtest/topic/a.html) for "http://172.20.19.134:8080/eimtest/topic/a.html"       
Action.c(27): Error -26627: HTTP Status-Code=404 (/eimtest/topic/a.html) for "http://172.20.19.134:8080/eimtest/topic/a.html"       
Action.c(27): Error -26627: HTTP Status-Code=404 (/eimtest/topic/a.html) for "http://172.20.19.134:8080/eimtest/topic/a.html"       
Action.c(27): web_url("MarqContAction.do") highest severity level was "ERROR", 342445 body bytes, 18925 header bytes, 66 chunking overhead bytes       
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.

小弟初学乍到,还请多帮忙

云层 发表于 2008-6-18 10:21:11

应该是登录后的http://172.20.19.134:8080/eimtest/topic/a.html这个内容是动态的,导致lr重新运行找不到这个页面,这需要用关联去实现

你可以先录制到登录把红字后面的脚本都注视,然后运行脚本,看看报告中的显示有什么不一样,再用关联函数去处理
页: [1]
查看完整版本: loadrunner录制的脚本无法执行问题--还请诸位高手多帮忙