qG7v]_K0/*实现目的:使用loadrunner调用httpwatch分析web前端性能*/51Testing软件测试网E$@Nex#rDip
$U'm4d
E:g
a0/*loadrunner代码*/
]4P?/Y(O r;{ S6?051Testing软件测试网#M X9P.R"wAction()51Testing软件测试网&@~O/o
s$R:FX
{51Testing软件测试网&ms^*]#{8dQ)aN!_
int sysst;51Testing软件测试网\ r\j{
TJ;\(Q
lr_think_time(10);
O |
Z0M:EHR9P0 sysst=system("D:\vbs_demo\httpwatch.vbs");
?1N|)dm0zC `0 lr_error_message("%d",sysst);//返回0-成功,1-失败51Testing软件测试网*d2usV%X
return 0;51Testing软件测试网g/}cJiPp6DF.n
}
c w\u
Y7xBo051Testing软件测试网)x_b)O/}/*vbs启用httpwatch代码*/
&K;S!RN8}YIm0Dim filename
CLw_-km bR5?0filename=FormatDateTime(Now,2)&FormatDateTime(Now,3)51Testing软件测试网 Z4H&ei8ga t
hO
filename=Replace(filename,":","")
+Mw ]X.Y U2I_S0filename=Replace(filename,"-","")51Testing软件测试网'A'~ Y
hajb
filename=Replace(filename,"/","")
n.{ U4|X`z5L0Dim control
#uM/r6TAcd0Set control=CreateObject("HttpWatch.controller")51Testing软件测试网8e#X-iX M0Uh/W
Dim plugin51Testing软件测试网+d%O,Bb2K&sI
Set plugin=control.IE.New
"k!gN`(mi1k0plugin.Record
(~
g"wG4{(K(K1d N0plugin.GotoUrl(http://wwww.baidu.com)
|9j(m.WF)jk&pk2c0control.Wait plugin, -1
8Zhk,v8h\Z
s0'stop recoording HTTP
(O/M
AY.IA _%y0plugin.stop51Testing软件测试网$ygUk7UV/P
'MsgBox filename
G`c-f|zO)B0plugin.Log.Save("D:\\"&filename&".hwl")51Testing软件测试网+T1WzI+t/@ ^
'close down IE