public class Selenium2Test extends TestCase {
public void testFoo() throws Exception {
WebDriver wd = new RemoteWebDriver(new URL("http://127.0.0.1:4444/wd/hub"), DesiredCapabilities.firefox());
try {
wd.get("http://www.yahoo.com/");
wd.findElement(By.name("p")).sendKeys("hello world");
wd.findElement(By.id("search-submit")).click();
// wd.waitForPageToLoad("10000");
assertTrue(wd.getTitle().contains("hello world"));
assertTrue(wd.getTitle().contains("Yahoo"));