如何使Java驱动/控制Webkit/Gecko? [英] How do get Java to drive/control webkit/gecko?
问题描述
我希望能够使用Java来控制webkit/gecko/konqueror浏览器.
I want to be able to have Java to control a webkit/gecko/konqueror browser.
Java应该能够执行以下操作:转到该URL;给我DOM树;模拟鼠标单击/键盘输入等等."
The Java should be able to do things like "go to this url; give me the DOM tree; simulate mouse click / keyboard input on blah".
最简单的方法是什么?网络上似乎有一些半途而废的解决方案,但是没有一个真正的开源项目.
What is the easiest way to do this? There seems to be some half-working solutions on the web, but no one true open source project.
在这种情况下做了什么?(我必须使用Java;但是我控制的引擎可以选择).
What have done in situation? (I have to use Java; but the engine I control is open to choose).
谢谢!
推荐答案
我不确定您到底需要做什么,但是 Selenium Remote Control 可与Firefox,IE和Safari一起使用.
I am not sure what exactly you need to do, but Selenium Remote Control works with Firefox, IE and Safari.
有了它,您可以编写如下的Java代码
With it, you can write Java code like the following
selenium.open("/");
selenium.type("q", "selenium rc");
selenium.click("btnG");
selenium.waitForPageToLoad("30000");
assertTrue(selenium.isTextPresent("Results * for selenium rc"));
这篇关于如何使Java驱动/控制Webkit/Gecko?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!