度过了一个冬眠,在春末夏初之际,补充自己的营养,努力学习,努力工作!

LR事务与子事务

上一篇 / 下一篇  2010-01-21 11:16:11 / 个人分类:LR练习

最近在看51上云层老师的书,顺便做下练习,增加自己的记忆
!jl k m iIP o.p m:Y0Action()
M&d l ~0RG0{51Testing软件测试网*] J-TZ4d

!}8g"`7|5M!m)\0    lr_start_transaction("Login");51Testing软件测试网 v-z:MRZ I8Gym E
51Testing软件测试网 k ] A)vf*GS}
    lr_start_sub_transaction("loginpage","Login");//打开登录页面所需要的时间的子事务开始51Testing软件测试网 Hr7D,n1OuRL

%MG8}X4R5lKw0    web_url("mcs.jw",
:I,xziQ"i]L0        "URL=http://sq.d.cn/wml/mcs.jw?act=my&djpos=000008",51Testing软件测试网c}aK#N1~uPA3q E#]
        "TargetFrame=",51Testing软件测试网$e7j4?`;i+u4_|#AG0D
        "Resource=1",51Testing软件测试网#v2JD6x,H2]f
        "RecContentType=text/vnd.wap.wml",
EI)] yjl!]5w M0        "Referer=",
9b ibW;[Gha0        "Snapshot=t6.inf",51Testing软件测试网d o@ Cg L~U
        LAST);
s"?fc R jq1E4uJ e0
@L#IS&X4\+`Nf dXK0    web_url("community_index.gif",51Testing软件测试网&W?)J+l-{$}%K;v
        "URL=http://d.cn/images/d-zone/community_index.gif?dd",
9h"I5]4CZ&{(V0        "TargetFrame=",
DV [] q~ h0        "Resource=1",51Testing软件测试网+^-r%yC!l\F
        "Referer=http://sq.d.cn/wml/mcs.jw?act=my&djpos=000008",51Testing软件测试网J$q:[ @@BP$X
        LAST);
-nZVZ-y([0
7?GR?d2fW8G!V0    web_url("today_hot.gif",
[MX SW}-E!g0        "URL=http://d.cn/images/today_hot.gif",51Testing软件测试网,C$l^/SR
        "TargetFrame=",51Testing软件测试网)R'`VL?$]$? @8e1h
        "Resource=1",51Testing软件测试网@yO9H&BU
        "Referer=http://sq.d.cn/wml/mcs.jw?act=my&djpos=000008",51Testing软件测试网!l9g eQd$qu{
        LAST);
zHM!q_(x3J~0
ykp~5e~0    web_url("new.gif",51Testing软件测试网Q9oW9t8\s%l_O^g
        "URL=http://d.cn/images/icon/new.gif",51Testing软件测试网;H(v*CP9M:A
        "TargetFrame=",51Testing软件测试网7qbio%Q cCd
        "Resource=1",51Testing软件测试网[ f~tYV"\u)d
        "Referer=http://sq.d.cn/wml/mcs.jw?act=my&djpos=000008",
M9l@8xC0        LAST);51Testing软件测试网$[krbG"oe_|

8u+h]3c{*U5fJ0    web_url("push.gif",51Testing软件测试网)fo4_2b5O4y_
        "URL=http://d.cn/images/icon/push.gif",51Testing软件测试网/~D%L^L_0f0h
        "TargetFrame=",51Testing软件测试网1j"b8[S#Nd'YD1z2J|*mnm
        "Resource=1",
)ZW~Kjf6i0        "Referer=http://sq.d.cn/wml/mcs.jw?act=my&djpos=000008",
:u.x2s+gl SY0        LAST);
Wx2v2[ k @j0    lr_end_sub_transaction("loginpage",LR_AUTO);//打开登录页面所需要的时间的子事务结束
:x J)b(w Z}r0
K Z#m9^$L;YST:dk0
~/j^'c$z0    lr_start_sub_transaction("submitlogin","Login");//登录操作所需要的时间的子事务开始51Testing软件测试网 PnI(N-r!q,fir

'y*NJ-j9Bz0    web_submit_data("mcs.jw_2",
'J9nf9SD0        "Action=http://sq.d.cn/wml/mcs.jw?act=login",
EV/p/p,~p;L0        "Method=POST",
_E7B6`l"v-d)q3}-h0        "TargetFrame=",
7f3U7L y2E0        "RecContentType=text/vnd.wap.wml",51Testing软件测试网P(I FJk:K(t)x
        "Referer=",
N;U1U!d%D1f^V8y0        "Snapshot=t7.inf",51Testing软件测试网AI2] d| m!R e
        "Mode=HTML",51Testing软件测试网1ETf d*?Te s
        ITEMDATA,51Testing软件测试网%pz A`N,m
        "Name=byid", "Value=0", ENDITEM,
jww"G![E3[ S0        "Name=username", "Value=dangle", ENDITEM,
5g2?E6UV g0        "Name=password", "Value=dcn", ENDITEM,51Testing软件测试网?/R5Y;d qHz
        "Name=validCode", "Value=5673", ENDITEM,51Testing软件测试网 rmr%o7m
        "Name=from", "Value=__SLASH__wml__SLASH__mcs.jw?act=my__AND__djpos=000008", ENDITEM,
z~6f u'B [1B0        "Name=pn", "Value=", ENDITEM,51Testing软件测试网8I\2[8hH.f
        EXTRARES,
JI F XU%na0        "Url=http://d.cn/images/mood/16.gif", "Referer=http://sq.d.cn/wml/mcs.jw?act=login", ENDITEM,51Testing软件测试网5i#Dy/|'m%MHap
        "Url=http://d.cn/images/newclub/0.gif", "Referer=http://sq.d.cn/wml/mcs.jw?act=login", ENDITEM,51Testing软件测试网#e2[ EhsE*W1uU8D-e
        "Url=http://d.cn/images/level_icon/3.png", "Referer=http://sq.d.cn/wml/mcs.jw?act=login", ENDITEM,
/P`{"K(sTgK7`0        "Url=http://d.cn/images/newclub/note.gif", "Referer=http://sq.d.cn/wml/mcs.jw?act=login", ENDITEM,51Testing软件测试网/k3Q3Jp!s4{$| lE/|
        "Url=http://d.cn/images/newclub/doc.gif", "Referer=http://sq.d.cn/wml/mcs.jw?act=login", ENDITEM,51Testing软件测试网5D(DPA*gQ,w
        "Url=http://d.cn/images/newclub/touch.gif", "Referer=http://sq.d.cn/wml/mcs.jw?act=login", ENDITEM,51Testing软件测试网 Hvb0A.r~ YX4F
        "Url=http://d.cn/images/newclub/blog.gif", "Referer=http://sq.d.cn/wml/mcs.jw?act=login", ENDITEM,51Testing软件测试网 KD,uk _ rh.Y
        "Url=http://d.cn/images/newclub/guest.gif", "Referer=http://sq.d.cn/wml/mcs.jw?act=login", ENDITEM,
2Q w|eoG:?1]-C"g0        "Url=http://d.cn/images/newclub/photo.gif", "Referer=http://sq.d.cn/wml/mcs.jw?act=login", ENDITEM,
#k0@^/G:tz9Gt/\{0        "Url=http://d.cn/images/newclub/renfan.gif", "Referer=http://sq.d.cn/wml/mcs.jw?act=login", ENDITEM,
d0i TH`.K(KQ:F0        "Url=http://d.cn/images/newclub/page.gif", "Referer=http://sq.d.cn/wml/mcs.jw?act=login", ENDITEM,51Testing软件测试网#k#S[H @
        "Url=http://d.cn/images/newclub/kickassmembericon.gif", "Referer=http://sq.d.cn/wml/mcs.jw?act=login", ENDITEM,51Testing软件测试网?~ A'GI
        LAST);
1X m,MXf)f"OlI HD0    lr_end_sub_transaction("submitlogin",LR_AUTO);//登录操作所需要的时间的子事务结束51Testing软件测试网/wT`:fT4p
    lr_end_transaction("Login",LR_AUTO);
6Jm { FP9H0
f \'Az!w|;__3f f^0    return 0;51Testing软件测试网x p3ai `KxS KFX$U
}51Testing软件测试网 wR.O/^(i%h7s
日志中可以看到所用时间
F H Rs3Y%bqsO)x0Action.c(44): Notify: Transaction "loginpage" ended with "Pass" status (Duration: 0.1303).51Testing软件测试网k@/~L/{j#Ur W
Action.c(78): Notify: Transaction "submitlogin" ended with "Pass" status (Duration: 0.9207).
vW]"OEg)M`0Action.c(79): Notify: Transaction "Login" ended with "Pass" status (Duration: 1.0873).
.Z6Q&fAzfF0因为有Vuser_int时间,故Login不等于loginpage与submitlogin时间之和

TAG:

 

评分:0

我来说两句

Open Toolbar