GUI自动化测试 [英] Automated testing of GUI

查看:48
本文介绍了GUI自动化测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题与单元测试无关.它适用于桌面产品.

这是关于测试 gui 并测试是否在正确的时间在正确的文本框中输入了正确的内容.

我以前工作的一家公司使用了 WinRunner(不同的部门,所以我对此知之甚少),但现在已被惠普关闭,但他们似乎并不介意你是留在惠普还是去惠普别处.您在注册之前无法阅读有关该产品的信息,这很烦人.

该工具必须与 MFC 配合使用(不可协商),理想的工具还...

  • 实现自动化.
  • 可编写脚本.
  • 自动处理不同的屏幕分辨率.
  • 能够窥探"单个静​​态文本框等.
  • 足够直观,因此非程序员也可以创建脚本.
  • 拥有报告工具,包括个人用户的电子邮件.

其他 SO 用户如何进行自动化 GUI 测试?

解决方案

我们使用 SAFS 框架 用于 Rational Robot (RRAFS).WinRunner (WRAFS) 也有 SAFS 实现,看起来他们有一个新的基于图像的测试"实现,我不熟悉.

这个框架在将 UI 实现与测试脚本分离方面做得很好.我已经测试了由两个不同团队(一个团队使用经典 ASP,一个团队使用 ASP.NET)开发的 Web 应用程序的四个版本,我只需要更改 UI 对象的应用程序映射,测试本身不需要改变.

也就是说,框架的语言很麻烦,需要习惯.就语言结构而言,它不是很健壮,但是通过一些努力,您可以做任何您需要做的事情.这有点像 Windows 批处理语言中的编程",但用于测试 ;)

要满足您的上述个人要求:

1) 该工具必须与 MFC 配合使用(不可协商).SAFS 框架使用第三方记录回放"工具来驱动测试,例如 Rational Robot 或 Mercury WinRunner.如果该工具可以与 MFC 应用程序交互,那么框架可以.我不知道基于图像的测试"实现如何推动测试,但我猜它也可以与 MFC 一起使用.

2) 自动化.SAFS 框架与 STAF 框架 集成,这将允许您自动执行测试.我有一个概念验证测试,它使用 STAF 从映像池中启动 VM 映像,安装被测应用程序,运行 RRAFS 测试,并将结果放在 Web 服务器上供其他人使用.

3) 可编写脚本.是的,但如前所述,它不是最强大的编程语言.我编写了一个 Excel 插件,我们的测试人员用它来编写他们的测试,从而稍微简化了一些事情.

4) 自动处理不同的屏幕分辨率.是的,因为它是在幕后"查看 UI 对象而不是屏幕.除了基于图像的测试"选项...

5) 能够窥探"单个静​​态文本框等是的,您可以等待 UI 对象出现、消失、拥有值、更改值等.

6) 足够直观,因此非程序员也可以创建脚本.经过一些训练.我们取得了有限的成功.有些 QA 人员可以编写测试,有些人会努力.

7) 有报告工具,包括个人用户的电子邮件.是的,使用 STAF 框架,您可以将结果发布到网络服务器、发送电子邮件等.

This question isn't about unit-testing. And it is for a desktop product.

This is about testing of the gui and testing that the right stuff is input in the right text box at the right time.

A company I used to work at used WinRunner (different department so I don't know much more that that), but that has now been shutdown by HP but they don't seem that bothered whether you stay with HP or go elsewhere. You can't read about the product until you've signed up which is annoying.

The tool has to work with MFC (non-negotiable) and the ideal tool will also...

  • be automated.
  • be scriptable.
  • work with different screen resolutions automatically.
  • be able to 'spy' on individual static text boxes, etc.
  • intuitive enough so non-programmers can create the scripts.
  • have reporting tools, including email of individual users.

What do other SO users do for automated GUI testing?

解决方案

We use the SAFS framework for Rational Robot (RRAFS). There are also SAFS implementations for WinRunner (WRAFS) and it looks like they have a new "Image-Based Testing" implementation, which I'm not familiar with.

This framework does a nice job of seperating the UI implementation from the test scripts. I've tested four releases of a web application developed by two different teams (one team using classic ASP, one using ASP.NET) and I only had to change the application map of my UI objects, the tests themselves didn't need to change.

That said, the language of the framework is cumbersome and takes getting used to. It's not very robust, in terms of language constructs, but with some effort you can do anything you need to. It's sort of like "programming" in Windows Batch language, but for tests ;)

To address your individual requirements above:

1) The tool has to work with MFC (non-negotiable). The SAFS framework uses a 3rd party "record-playback" tool to drive the tests, like Rational Robot or Mercury WinRunner. If that tool can interact with MFC apps, then the framework can. I don't know how the "Image-Based Testing" implementation drives the tests, but I'd guess it can also work with MFC.

2) be automated. The SAFS framework integrates with the STAF framework, which will allow you to automate the execution of your tests. I have a proof-of-concept test that uses STAF to start a VM image from a pool of images, install the application under test, run the RRAFS test, and put the results on a web server for others to get at.

3) be scriptable. Yes, but as mentioned, it's not the most robust programming language. I wrote an Excel add-in that our testers use to write their tests that simplifies things a little bit.

4) work with different screen resolutions automatically. Yes, since it's looking "under the covers" at the UI objects and not the screen. Except for maybe the "Image-based Testing" option...

5) be able to 'spy' on individual static text boxes, etc. Yes, you can wait for a UI object to appear, disapper, to have a value, for a value to be changed, etc.

6) intuitive enough so non-programmers can create the scripts. With some training. We've had limited success. Some QA folks can write the tests, some struggle.

7) have reporting tools, including email of individual users. Yes, using the STAF framework you can post results to a web server, send out emails, etc.

这篇关于GUI自动化测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆