使用 HTMLUnit 测试 Java 脚本
我正在尝试学习如何使用 HTMLUnit 来测试某些网站的 JavaScript 元素。
我尝试做一些作业并使用 HTMLUnit 的操作方法,但没有成功。当我尝试运行我的程序时,我遇到了困难,我需要选择如何运行它,它给了我一个我以前从未处理过的选项列表。请帮我解决这个问题?
所有,我得到的是一个控制台窗口正在等待一些输入?显然这不是我期望发生的事情。
I'm trying to learn how to use HTMLUnit in order to test some website's JavaScripts elements.
I've tried doing some homework and using the HTMLUnit's How-To's but with no success. I get stuck when trying to run my program, I need to choose how to run it and it gives me a list of option which I never handled before. Please help me on this?
All, I get is a console window waiting for some input? Thats not what I was expecting to happen obviously.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试在 homePage() 方法上方添加 @Test ?
Did you try adding @Test above the homePage() method?
我建议使用 QUnit 来测试 Javascript - 这就是 jQuery 团队使用的。
I'd recommend using QUnit to test Javascript - that's what the jQuery team uses.