WinWaitActive Timeout in AutoIT
March 1, 2010
前两天又玩了玩SilkTest,然后试验了一下WinWaitActive的Timeout功能。用AutoIT做测试最大的难处就是TestCase的是Pass还是Fail最后不好处理。除了Actual Result和Expected Result不一致可以把Test Case设为fail,还有很多原因会把TestCase fail掉。其中一个就是该出来的窗口没有出来,这时候就是一个错误,SilkTest有很强大的错误处理机制,如果一个语句超时(timeout)整个TestCase自动判为fail。用AutoIT一般这个脚本就会傻等下去导致后边的TestCase全都等着。其实比较正规的处理方法就是在用WinWaitActive的时候使用Timeout这个参数,比如下边一个脚本:
-
Run("C:\Program Files (x86)\Lavasoft\Ad-Aware\Ad-Aware.exe")
-
-
MsgBox(0, "Warning", "Ad-Aware Window is not found!")
-
-
-
MsgBox(0, "Information", "Ad-Aware launches successfully.")
这样的话当窗口没出来或者出了一个错误的窗口的话就会自动弹出错误信息,然后终止TestCase。
Related posts:
- 打开web2py的远程访问
- Py2exe编译Pywinauto程序
- 给Squid添加密码验证
- SCIM在Arch Linux下的正确设置方法
- Arch Linux的X11启动方案选择
Tags: autoit, software testing, winwaitactive, 技巧, 软件测试
The entry 'WinWaitActive Timeout in AutoIT' was posted
on March 1, 2010 at March 1, 2010
and last modified on 三月 1st, 2010 at 4:02 下午, and is filed under 小技巧, 技术, 测试.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.