求助各位大神
在loadrunner中手动关联,写好了关联函数,也替换了该替换的,可是回放的时候还是有错,谁能给我看看到底错在哪呀,在此感谢各位了这是写的代码:
Action()
{
web_reg_save_param("login1",
"LB=name=userSession value=", "RB=>", LAST );
web_url("WebTours",
"URL=http://127.0.0.1:1080/WebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_url("favicon.ico",
"URL=http://127.0.0.1:1080/favicon.ico",
"Resource=1",
"Referer=",
LAST);
web_submit_data("login.pl",
"Action=http://127.0.0.1:1080/WebTours/login.pl",
"Method=POST",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={login1}", ENDITEM,
"Name=username", "Value=wuyan", ENDITEM,
"Name=password", "Value=wuyan", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
LAST);
web_submit_data("login.pl_2",
"Action=http://127.0.0.1:1080/WebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=117442.388011341zAtAQtcpiDDDDDDDDzctfpzfH", ENDITEM,
"Name=username", "Value=wuyan", ENDITEM,
"Name=password", "Value=wuyan", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
"Name=login.x", "Value=73", ENDITEM,
"Name=login.y", "Value=10", ENDITEM,
LAST);
web_image("SignOff Button",
"Alt=SignOff Button",
"Snapshot=t3.inf",
LAST);
return 0;
}
这是回放日志:
Virtual User Script started at : 2015-12-11 17:44:33
Starting action vuser_init.
Web Turbo Replay of LoadRunner 11.0.0 for WINXP; build 8859 (Aug 18 2010 20:14:31)
Run Mode: HTML
Run-Time Settings file: "D:\ProgrammeFiles\TestScripts\login1\\default.cfg"
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(3): Registering web_reg_save_param was successful
Action.c(7): Detected non-resource "http://127.0.0.1:1080/WebTours/header.html" in "http://127.0.0.1:1080/WebTours/"
Action.c(7): Detected non-resource "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true" in "http://127.0.0.1:1080/WebTours/"
Action.c(7): Found resource "http://127.0.0.1:1080/WebTours/images/hp_logo.png" in HTML "http://127.0.0.1:1080/WebTours/header.html"
Action.c(7): Found resource "http://127.0.0.1:1080/WebTours/images/webtours.png" in HTML "http://127.0.0.1:1080/WebTours/header.html"
Action.c(7): Detected non-resource "http://127.0.0.1:1080/WebTours/nav.pl?in=home" in "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true"
Action.c(7): Detected non-resource "http://127.0.0.1:1080/WebTours/home.html" in "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true"
Action.c(7): Found resource "http://127.0.0.1:1080/WebTours/JSFormSubmit.js" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?in=home"
Action.c(7): Found resource "http://127.0.0.1:1080/WebTours/images/mer_login.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?in=home"
Action.c(7): web_url("WebTours") was successful, 6873 body bytes, 1808 header bytes
Action.c(16): Warning -26627: HTTP Status-Code=404 (Not found) for "http://127.0.0.1:1080/favicon.ico"
Action.c(16): web_url("favicon.ico") highest severity level was "warning", 114 body bytes, 144 header bytes
Action.c(22): Detected non-resource "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home" in "http://127.0.0.1:1080/WebTours/login.pl"
Action.c(22): Detected non-resource "http://127.0.0.1:1080/WebTours/login.pl?intro=true" in "http://127.0.0.1:1080/WebTours/login.pl"
Action.c(22): Found resource "http://127.0.0.1:1080/WebTours/images/flights.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"
Action.c(22): Found resource "http://127.0.0.1:1080/WebTours/images/itinerary.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"
Action.c(22): Found resource "http://127.0.0.1:1080/WebTours/images/in_home.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"
Action.c(22): Found resource "http://127.0.0.1:1080/WebTours/images/signoff.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home"
Action.c(22): web_submit_data("login.pl") was successful, 5694 body bytes, 1482 header bytes
Action.c(34): web_submit_data("login.pl_2") was successful, 795 body bytes, 225 header bytes
Action.c(50): Error -27987: Requested image not found
Action.c(50): web_image("SignOff Button") highest severity level was "ERROR", 0 body bytes, 0 header bytes
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated. 请求的图片不存在 web_image("SignOff Button",
"Alt=SignOff Button",
"Snapshot=t3.inf",
LAST);
直接把这个干掉吧,跟参数配置没有关系,图片的问题 请求图片失败,此图片是否影响测试,可以去掉 关联本身是没有问题,是成功了的,这报错不是关联的问题 URL=http://127.0.0.1:1080/WebTours/
动态参数据
设置login1时,信息没置完整。 fhhh_eyou 发表于 2015-12-14 13:42
URL=http://127.0.0.1:1080/WebTours/
动态参数据
设置login1时,信息没置完整。
不是很懂你的意思,原谅我。。不是很聪明 但是讲课的老师也是一样的代码,为什么他的没报错呢?
页:
[1]