vikesgao 发表于 2011-6-9 15:40:35

一只聪明的猴子帮你做测试="猴子测试"

'C:\perflosg\查看log
systemutil.Run "logman","start perf_log"
systemutil.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE","http://108.88.3.123:8081/admin/index.jsp"

'Net获取屏幕高度与宽度
Set CreateInstance=DotNetFactory.CreateInstance("System.Windows.Forms.Screen","System.Windows.Forms")
width=CreateInstance.primaryscreen.workingarea.width
height=CreateInstance.primaryscreen.workingarea.height
'msgbox width & "," & height

For i =1 to 10000
        x=RandomNumber(0,Width)
'去掉浏览器顶部的功能,主要测试WEB的网页部份
        y=RandomNumber(100,Height)

Set APIINstance=DotNetFactory.CreateInstance("WinAPI.MouseAPI","D:\WinAPI.dll")
APIINstance.MoveMouse x,y
Reporter.ReportEvent micDone,"MouseMove","光标" & x & ", " &y
APIINstance.ClickMouse "Left",x,y,0,0
Reporter.ReportEvent micDone,"MouseClick","光标" & x & "," & y

key=array("1","2","3","4","5","6","7","8","9","0","q","w","e","r","t","y","u","i","o","p","a","s","d","f","g","h","j","k","l","z","x","c","v","b","n","m","!","@","#","$","%","^","&","*","(",")","_","+","{","}","|",":","<",">","?",",",".","/",";","'","[","]","\","=","-")
n=randomnumber(0,2)
str=key(n)

Set SendkeyInstance=DotNetFactory.CreateInstance("System.Windows.Forms.SendKeys","System.Windows.Forms")
SendkeyInstance.SendWait str

str=Now
Set regEx=new RegExp
regEx.Pattern=":"
regEx.IgnoreCase=true
str1=regEx.replace(str,"_")
str2=regEx.replace(str1,"_")
str3=str2 & "_"&RandomNumber(0,10000)
DeskTop.CaptureBitmap str3 & ".png"

Next

systemutil.Run "logman","stop perf_log"


希望大家测试产品时进行猴子测试,有效找不内存溢出问题!

vikesgao 发表于 2011-6-9 17:09:20

:dizzy:自己顶一下

17800455 发表于 2011-6-10 11:02:12

没太大作用..........

云层 发表于 2011-6-10 11:10:57

如果是c/s架构我觉得可能还有意义,b/s的内容我觉得还不如直接用协议做随机丢包来的直接也更有效的发现内存泄露的问题
页: [1]
查看完整版本: 一只聪明的猴子帮你做测试="猴子测试"