Archive for June, 2010

Running Selenium Webdriver remotely

Want to run your tests on a remote VM rather on your local machine using Webdriver.

Below code would be a start.

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

URL url = new URL(""); //Could be your remote VM where you to run your tests

DesiredCapabilities capabilities;
capabilities = DesiredCapabilities.firefox();

//You can test multiple type of browser
//capabilities = DesiredCapabilities.internetExplorer(); 

driver = new RemoteWebDriver(url, capabilities);

//Open the web site

//Type Search Term
(driver.findElement("q"))).sendKeys("Test Search Query"); 

//Click submit button