51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1839|回复: 3
打印 上一主题 下一主题

[原创] 一只聪明的猴子帮你做测试="猴子测试"

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 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"


希望大家测试产品时进行猴子测试,有效找不内存溢出问题!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2011-6-9 17:09:20 | 只看该作者
自己顶一下
回复 支持 反对

使用道具 举报

  • TA的每日心情
    开心
    2018-7-13 14:04
  • 签到天数: 6 天

    连续签到: 1 天

    [LV.2]测试排长

    3#
    发表于 2011-6-10 11:02:12 | 只看该作者
    没太大作用..........
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    4#
    发表于 2011-6-10 11:10:57 | 只看该作者
    如果是c/s架构我觉得可能还有意义,b/s的内容我觉得还不如直接用协议做随机丢包来的直接也更有效的发现内存泄露的问题
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-15 04:52 , Processed in 0.072815 second(s), 27 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表