如果晚上月亮升起的时候,月光照到我的门口,我希望月光女神能满足我一个愿望,我想要一双人类的手。我想用我的双手把我的爱人紧紧地拥在怀中,哪怕只有一次。如果我从来没有品尝过温暖的感觉,也许我不会这样寒冷;如果我从没有感受过爱情的甜美,我也许就不会这样地痛苦。如果我没有遇到善良的佩格,如果我从来不曾离开过我的房间,我就不会知道我原来是这样的孤独.
HTML和URL录制模式
上一篇 / 下一篇 2012-06-25 16:27:22 / 个人分类:loadrunner
基于2中模式录制相同的脚本:打开首页
1、HTML的录制模式:
Action()
I$l)HV3EQ&o.o0{
I$l)HV3EQ&o.o0{
web_url("WebTours",
GY$Iz1H!A0 "URL=http://127.0.0.1:1080/WebTours/",
nuS(~V1m%yMz qj0 "Resource=0",51Testing软件测试网.p"es_8V l9LO1}
"RecContentType=text/html",
V!}L&K5T/M3q4W mp-d Br0 "Referer=",
cbWd%a d0 "Snapshot=t22.inf",51Testing软件测试网1vX(` tnFQ
"Mode=HTML",51Testing软件测试网w0B'}*O"ulC
LAST);
GY$Iz1H!A0 "URL=http://127.0.0.1:1080/WebTours/",
nuS(~V1m%yMz qj0 "Resource=0",51Testing软件测试网.p"es_8V l9LO1}
"RecContentType=text/html",
V!}L&K5T/M3q4W mp-d Br0 "Referer=",
cbWd%a d0 "Snapshot=t22.inf",51Testing软件测试网1vX(` tnFQ
"Mode=HTML",51Testing软件测试网w0B'}*O"ulC
LAST);
return 0;
F(JdPfuK,c8G0T0}
F(JdPfuK,c8G0T0}
2、URL录制模式:
Action()
-ZB$xvu@0{
-ZB$xvu@0{
web_url("WebTours",51Testing软件测试网}V+m jT*jd_
"URL=http://127.0.0.1:1080/WebTours/",51Testing软件测试网aZ'RFlV jZN
"Resource=0",
7uFAt"qyKpOp^0 "RecContentType=text/html",
*Y:Pt rEg^#Q!j0 "Referer=",51Testing软件测试网/C%]'z v)m9?kol
"Snapshot=t23.inf",51Testing软件测试网v8T q(k4BU!BSph
"Mode=HTTP",
2p:F?,S6f0 LAST);
"URL=http://127.0.0.1:1080/WebTours/",51Testing软件测试网aZ'RFlV jZN
"Resource=0",
7uFAt"qyKpOp^0 "RecContentType=text/html",
*Y:Pt rEg^#Q!j0 "Referer=",51Testing软件测试网/C%]'z v)m9?kol
"Snapshot=t23.inf",51Testing软件测试网v8T q(k4BU!BSph
"Mode=HTTP",
2p:F?,S6f0 LAST);
web_concurrent_start(NULL);
web_url("header.html",
7x P"t |b5E*m5a F&u&x0 "URL=http://127.0.0.1:1080/WebTours/header.html",51Testing软件测试网*c\ {4Bu,uX8~.o,rt
"Resource=0",
qJ6fgwv\+u0 "RecContentType=text/html",
eq'pO-Y;a?@0 "Referer=http://127.0.0.1:1080/WebTours/",
!G4J-{0UVS"}D.G0 "Snapshot=t24.inf",51Testing软件测试网rq&}eC'lf
"Mode=HTTP",
;Co3uc^\0 LAST);
7x P"t |b5E*m5a F&u&x0 "URL=http://127.0.0.1:1080/WebTours/header.html",51Testing软件测试网*c\ {4Bu,uX8~.o,rt
"Resource=0",
qJ6fgwv\+u0 "RecContentType=text/html",
eq'pO-Y;a?@0 "Referer=http://127.0.0.1:1080/WebTours/",
!G4J-{0UVS"}D.G0 "Snapshot=t24.inf",51Testing软件测试网rq&}eC'lf
"Mode=HTTP",
;Co3uc^\0 LAST);
web_url("welcome.pl",
s2Xz|'Kd&_k0 "URL=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true",51Testing软件测试网}0zQM*KJ
"Resource=0",
0s+K'B7d6|;UOgv~E3n0 "RecContentType=text/html",51Testing软件测试网(uc6W0};p#C*_M)C+H{
"Referer=http://127.0.0.1:1080/WebTours/",
5q_XG5`j&mQDi0 "Snapshot=t26.inf",51Testing软件测试网`qj Q jz S
"Mode=HTTP",51Testing软件测试网B&VIW f
LAST);
s2Xz|'Kd&_k0 "URL=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true",51Testing软件测试网}0zQM*KJ
"Resource=0",
0s+K'B7d6|;UOgv~E3n0 "RecContentType=text/html",51Testing软件测试网(uc6W0};p#C*_M)C+H{
"Referer=http://127.0.0.1:1080/WebTours/",
5q_XG5`j&mQDi0 "Snapshot=t26.inf",51Testing软件测试网`qj Q jz S
"Mode=HTTP",51Testing软件测试网B&VIW f
LAST);
web_concurrent_end(NULL);
web_concurrent_start(NULL);
web_url("hp_logo.png",51Testing软件测试网Rpu R1qBx7m
"URL=http://127.0.0.1:1080/WebTours/images/hp_logo.png",51Testing软件测试网'sp"{d@0]]5J
"Resource=1",51Testing软件测试网8D:e,W|VG Q
"RecContentType=image/png",51Testing软件测试网IE }W0l8KL`
"Referer=http://127.0.0.1:1080/WebTours/header.html",51Testing软件测试网4a~'IF KXFm
"Snapshot=t25.inf",51Testing软件测试网4[.Z4Y8J"g
LAST);
"URL=http://127.0.0.1:1080/WebTours/images/hp_logo.png",51Testing软件测试网'sp"{d@0]]5J
"Resource=1",51Testing软件测试网8D:e,W|VG Q
"RecContentType=image/png",51Testing软件测试网IE }W0l8KL`
"Referer=http://127.0.0.1:1080/WebTours/header.html",51Testing软件测试网4a~'IF KXFm
"Snapshot=t25.inf",51Testing软件测试网4[.Z4Y8J"g
LAST);
web_url("webtours.png",51Testing软件测试网IKY"RV+n5}5c9p
"URL=http://127.0.0.1:1080/WebTours/images/webtours.png",
`:x7|sOO0 "Resource=1",51Testing软件测试网 c!Q8l3xN.X
"RecContentType=image/png",
-cKU4?7c#o0 "Referer=http://127.0.0.1:1080/WebTours/header.html",
/I}Fn];Zg6^-n^0 "Snapshot=t27.inf",
9mb c"rN0mHo0 LAST);
"URL=http://127.0.0.1:1080/WebTours/images/webtours.png",
`:x7|sOO0 "Resource=1",51Testing软件测试网 c!Q8l3xN.X
"RecContentType=image/png",
-cKU4?7c#o0 "Referer=http://127.0.0.1:1080/WebTours/header.html",
/I}Fn];Zg6^-n^0 "Snapshot=t27.inf",
9mb c"rN0mHo0 LAST);
web_concurrent_end(NULL);
web_concurrent_start(NULL);
web_url("home.html",51Testing软件测试网n!lC@.v-Wd9w0w#edM
"URL=http://127.0.0.1:1080/WebTours/home.html",
%dkk#p#kC+Fr0 "Resource=0",51Testing软件测试网]!~&\)@8A,zt
"RecContentType=text/html",
5m)c:w5tu.l-|u"t1u0 "Referer=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true",51Testing软件测试网s+X4LCMs9d*B4q3e
"Snapshot=t28.inf",51Testing软件测试网-T8x.X8q+O+c ~R
"Mode=HTTP",
8[f,p8ZV9Vv/g Gv&z;T0 LAST);
"URL=http://127.0.0.1:1080/WebTours/home.html",
%dkk#p#kC+Fr0 "Resource=0",51Testing软件测试网]!~&\)@8A,zt
"RecContentType=text/html",
5m)c:w5tu.l-|u"t1u0 "Referer=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true",51Testing软件测试网s+X4LCMs9d*B4q3e
"Snapshot=t28.inf",51Testing软件测试网-T8x.X8q+O+c ~R
"Mode=HTTP",
8[f,p8ZV9Vv/g Gv&z;T0 LAST);
web_url("nav.pl",51Testing软件测试网3Q m)f
vO,N3z4E&m)?'^t
"URL=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
C~#N\7gYJ;SY+o1U9v0 "Resource=0",
u3q3X3d-k0 "RecContentType=text/html",
RB DX'J Y+~0 "Referer=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true",51Testing软件测试网Y+h{Y8OE
"Snapshot=t29.inf",
2ad)L)h(kaT5H0 "Mode=HTTP",51Testing软件测试网rO ~;K/e2R K
LAST);
"URL=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
C~#N\7gYJ;SY+o1U9v0 "Resource=0",
u3q3X3d-k0 "RecContentType=text/html",
RB DX'J Y+~0 "Referer=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true",51Testing软件测试网Y+h{Y8OE
"Snapshot=t29.inf",
2ad)L)h(kaT5H0 "Mode=HTTP",51Testing软件测试网rO ~;K/e2R K
LAST);
web_concurrent_end(NULL);
web_concurrent_start(NULL);
web_url("JSFormSubmit.js",51Testing软件测试网l5q
Y!s?b~
"URL=http://127.0.0.1:1080/WebTours/JSFormSubmit.js",
z d&O$^e9_``0 "Resource=1",
j0d5zPXTe6u0 "RecContentType=application/x-javascript",51Testing软件测试网RZR+D"tdul"Y
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",51Testing软件测试网.ss2r{cq
"Snapshot=t30.inf",51Testing软件测试网&_ao$rM~rBd:B
LAST);
"URL=http://127.0.0.1:1080/WebTours/JSFormSubmit.js",
z d&O$^e9_``0 "Resource=1",
j0d5zPXTe6u0 "RecContentType=application/x-javascript",51Testing软件测试网RZR+D"tdul"Y
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",51Testing软件测试网.ss2r{cq
"Snapshot=t30.inf",51Testing软件测试网&_ao$rM~rBd:B
LAST);
web_url("mer_login.gif",
4~;yi!dn"M4VN0 "URL=http://127.0.0.1:1080/WebTours/images/mer_login.gif",
)l1v%[f5j.N n4q0 "Resource=1",
C4H,G/|Cn\{ S0 "RecContentType=image/gif",51Testing软件测试网&S6u4C c/g&e3`&D?E
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",51Testing软件测试网dr#Tg7_0WQ
"Snapshot=t31.inf",
#e7at*T2Q?!Ea0 LAST);
4~;yi!dn"M4VN0 "URL=http://127.0.0.1:1080/WebTours/images/mer_login.gif",
)l1v%[f5j.N n4q0 "Resource=1",
C4H,G/|Cn\{ S0 "RecContentType=image/gif",51Testing软件测试网&S6u4C c/g&e3`&D?E
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",51Testing软件测试网dr#Tg7_0WQ
"Snapshot=t31.inf",
#e7at*T2Q?!Ea0 LAST);
web_concurrent_end(NULL);
return 0;51Testing软件测试网-X~e}5P*c$B
}51Testing软件测试网3Z1B+v t:j
}51Testing软件测试网3Z1B+v t:j
- 从代码量上看:HTML的代码量少很多,URL的代码量很多
- HTML-based 方式对每个页面录制形成一条语句,对LoadRunner来说,在该模式下,访问一个页面,首先会与服务器之间建立一个连接获取页面的内容,然后从页面中分解得到其他的元素(component),然后建立几个连接分别获取相应的元素,会对每个页面录制:web_URL,web_link,web_sumit_form
- URL-based 方式录制来自server的所有的请求和资源。将每条客户端发出的请求录制成一条语句,对LoadRunner来说,在该模式下,一条语句只建立一个到服务器的连接,LoadRunner提供了web_concurrent_start和web_concurrent_end函数模拟HTML-based的工作方式它自动录制每一个HTTP资源为URL的步骤。这种录制模式会抓取非HTML应用程序
- 一般B/S架构的都使用HTML-based方式录制,C/S架构的应用程序使用URL-based方式录制;
"f$o3X$IO|'tF Bt0我们关注在什么情况下使用HTML,URL:
ng} P*L LN}}_0(A] C7J(uq0一般基于标准IE访问的B/S架构,选用HTML-based下的A-script. containing explicit URLs only(基于URL请求的录制),这中录制方式不会有任何依赖关系;如果选择用非IE标准的C/S架构的建议使用URl-based录制这样可以确保不会遗漏Http请求。