有哪些选项可以为用Java Swing编写的GUI构建自动化测试?
我想测试一些使用NetBeans Swing GUI Builder编写的GUI,所以不需要对测试代码进行特殊篡改就可以工作的GUI将是理想的。
发布于 2015-09-24 21:15:13
最近我遇到了FEST,它看起来很有前途,除了开发者announced in 2012 that development would not continue。
AssertJ是FEST的一个分支,对我来说工作得很好。它得到了积极的维护(在撰写本文时),支持Java 8,对一些流行的库(如Guava和Joda Time )具有断言,并且有很好的文档记录。它也是免费和开放的。
发布于 2008-09-18 03:15:27
我目前使用的是FEST。它可以在JUnit上运行,也可以截取失败测试的屏幕截图。
它有默认的组件搜索方法,可以查找正在测试的组件的名称(需要手动设置),但您也可以通过将组件传递给给定的组件来为其生成测试程序。
发布于 2009-06-16 03:56:54
您可以尝试使用Cucumber和Swinger,以通俗易懂的英语为Swing GUI应用程序编写功能验收测试。Swinger在后台使用Netbeans的Jemmy库来驱动应用程序。
Cucumber允许您编写这样的测试:
Scenario: Dialog manipulation
Given the frame "SwingSet" is visible
And the frame "SwingSet" is the container
When I click the menu "File/About"
Then I should see the dialog "About Swing!"
Given the dialog "About Swing!" is the container
When I click the button "OK"
Then I should not see the dialog "About Swing!"
看一看这个Swinger video demo,看看它的实际效果。
https://stackoverflow.com/questions/91179
复制相似问题