There are several solutions in Java without using an RC server:
1) To launch the selenium browser:
DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setBrowserName("safari"); CommandExecutor executor = new SeleneseCommandExecutor(new URL("http://localhost:4444/"), new URL("http://www.google.com/"), capabilities); WebDriver driver = new RemoteWebDriver(executor, capabilities);
2) For selenium teams:
// You may use any WebDriver implementation. Firefox is used here as an example WebDriver driver = new FirefoxDriver(); // A "base url", used by selenium to resolve relative URLs String baseUrl = "http://www.google.com"; // Create the Selenium implementation Selenium selenium = new WebDriverBackedSelenium(driver, baseUrl); // Perform actions with selenium selenium.open("http://www.google.com"); selenium.type("name=q", "cheese"); selenium.click("name=btnG"); // Get the underlying WebDriver implementation back. This will refer to the // same WebDriver instance as the "driver" variable above. WebDriver driverInstance = ((WebDriverBackedSelenium) selenium).getWrappedDriver(); //Finally, close the browser. Call stop on the WebDriverBackedSelenium instance //instead of calling driver.quit(). Otherwise, the JVM will continue running after //the browser has been closed. selenium.stop();
Described here: http://seleniumhq.org/docs/03_webdriver.html
Google for something like that in C #. There is no other way.
ctekk source share