screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" title=点击图片可在新窗口打开 src="https://www.ltesting.net/attachments/2009/04/110593_200904151010086L7Gl.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
在以上界面,主要设置两个参数:
(1) Test duration设置,这里设置测试进行时间,默认为5分钟;
(2) 在Counters标签页设置一些测试性能数据;
以上设置完成以后,就可以开始修改VBS代码了,我们没必要遍历整个VBS代码,只看一些主要的:
Test.SendRequest("http://localhost/")
以上是默认代码,我们可以修改为以下代码:
Test.SendRequest("http://localhost/philipq/wsmessages/wsmsg.asmx/MPost?webKey=w2k&UName=Ad&UPassword=pwd&UTo=Admin&UMessage=ACT+Test")
以上代码的编写应该根据自身程序的特点来修改,以达到最好测试效果。
执行测试
点击工具栏的【Start】按钮开始测试如图):
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" title=点击图片可在新窗口打开 src="https://www.ltesting.net/attachments/2009/04/110593_200904151010087mW5F.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
测试进行的时候,会出现以下窗口提示(如图):
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" title=点击图片可在新窗口打开 src="https://www.ltesting.net/attachments/2009/04/110593_200904151010088n7hh.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
以上界面显示程序测试的时间、剩余时间、每秒提交的Request数量、提交的Request总量、错误数量等。点击按钮【Show details】可以查看详细数据。
测试结束以后,就可以查看测试的结果了。
阅读测试结果
测试完成以后,可以在图二左边的Result分支点击查看测试结果,在右方的报表栏我们可以查看到以下数据:OverView、Graphs、Requests等,下图是一个OverView的数据举例:
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" title=点击图片可在新窗口打开 src="https://www.ltesting.net/attachments/2009/04/110593_200904151010089I7kZ.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
从以上报告可以看到,测试的程序每秒提交request23次,总共1400次。
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/