如何编写一个程序来自动化Eclipse-RCP GUI的集成测试?
我并不是特别熟悉现代桌面 GUI 程序开发,我是在 xlib 时代长大的,在 90 年代末接触过一些 Visual Basic 和 MFC,然后才全职从事服务器开发。话虽如此,我已经在 Eclipse RCP 中开发了桌面应用程序(可以完全访问源代码),并且我想构建一些集成测试。理想情况下,我希望能够用 Java(或其他语言,如果绝对必要)编写以下代码:
1. 在文本框“foo”中输入一段特定的文本。
2. 在按钮“bar”上执行鼠标单击。
3. 读取文本框“baz”中显示的文本值,并将其与预期值进行比较。
特别是,我更愿意避免一种要求用户在运行时记录一组操作的测试风格 。编程,然后可以播放它们。这是否可能?如果可以,我该怎么做?当然,免费/开源软件是首选。
I am not particularly conversant with modern desktop GUI program development, having grown up in the days of xlib and worked a bit in Visual Basic and MFC in the late 90s before switching to server development full time. With that said, I have desktop applications developed in Eclipse RCP (with full access to source) and I would like to build some integration tests. Ideally I would like to be able to write the following sort of code in Java (or some other language if absolutely necessary):
1. Enter a specific piece of text into text box "foo".
2. Execute mouse click on button "bar".
3. Read the text value displayed in text box "baz" and compare it to the expected value.
In particular, I would prefer to avoid a style of testing where a user is required to record a set of actions on a running program and can then play them back. Is this at all possible and, if so, how would I do it? Free/Open Source software for this is preferred, of course.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请查看
TFTP 一个用于测试和分析的 Eclipse 项目。
SWTBot “用于 SWT、Eclipse 插件和基于 Eclipse RCP 的应用程序的开源跨平台 UI 测试工具” 。 此处适用于 SWTBot + TFTP。 SWTBot 也可以很好地与 JUnit 配合使用。
Please have a look at
TFTP an eclipse project for testing and profiling.
SWTBot "an open source cross platform UI testing tool for SWT, Eclipse plug-ins and Eclipse RCP based application". here for SWTBot + TFTP. SWTBot works also well with JUnit.
嘿。
您还可以编写类似单元测试的测试,在应用程序周围单击并检查给定条件(断言给定属性)。您可以使用:
Hey.
You could also write unitTest-like tests that click around application and check for given conditions (assert given properties). You could use: