views:

43

answers:

1

I want to be able to have Java to control a webkit/gecko/konqueror browser.

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.

What have done in situation? (I have to use Java; but the engine I control is open to choose).

Thanks!

+2  A: 

I am not sure what exactly you need to do, but Selenium Remote Control works with Firefox, IE and Safari.

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"));
Thilo