将 FEST-Swing 与 Java 小程序结合使用
我发现 FEST-Swing 具有以下功能自动化 Java 小程序上的 UI 操作。
FEST-Swing 还可以测试桌面应用程序以及小程序(在 查看器和浏览器内。)
我尝试准备一个脚本来查看其功能,但我无法弄清楚如何将小程序源加载到 FEST 来采取操作。
如何将 Java Applet 加载到 FEST 中?具体来说,我想要一个有关如何将以下小程序加载到 FEST 的示例。 http://java.sun.com/applets/ jdk/1.4/demo/applets/GraphicsTest/example1.html
我在脚本中想要的只是单击“下一步”和“上一步”按钮。
I found that FEST-Swing has the capability to automate UI actions on Java applets.
FEST-Swing can also test desktop applications as well as applets (in a
viewer and in-browser.)
I tried to prepare a script to see its capabilities, but I could not figure out how to load an applet source to FEST to take actions.
How can I load a Java Applet into FEST? Specifically, I would like an example on how to load the below applet in to FEST.
http://java.sun.com/applets/jdk/1.4/demo/applets/GraphicsTest/example1.html
All I want in the script is to click on Next and Previous buttons.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里。要使其运行,您需要将 Next-Button 的类型从
Button
更改为JButton
,因为 FEST 仅适用于 SWING 组件,不适用于 AWT 组件。另外,您必须设置按钮的名称,以便 FEST 可以识别测试用例中的按钮。为此,请添加以下行:现在您可以在测试用例中找到您的按钮。我使用了这个测试用例,效果很好:
how to load an
Applet
to aFramFixture
is described here. To get this running you need to change the type of the Next-Button fromButton
toJButton
because FEST works only on SWING Components and not on AWT Components. Additional you have to set the Name of the Button, so that FEST can identity the button in the testcase. To do this, add this line:now you can find your Button in the testcase. I used this TestCase and it worked well: