Monday, 11 February 2013

Upgradation from selenium to webriver

I am using selenium 2.0 in my automation suite . Few days before i tried to use webdriver and thought to upgrade from selenium 1.0 to selenium 2.0.

In my automation framework i use selenium grid to allow multiple execution .
To start the hub/rc follow below steps :
  1. java -jar selenium-server-standalone-2.24.1 -role hub //to start hub
  2. java -jar selenium-server-standalone-2.24.1 -role node -hub http://localhost:4444/grid/register // to start rc
         DesiredCapabilities c=  DesiredCapabilities.firefox();
        c.setJavascriptEnabled(true);
        WebDriver driver=null;
        try{
          driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), c);
        }
        catch (Exception e) {
            // TODO: handle exception
        }
       
   Selenium  selenium=new WebDriverBackedSelenium(driver,"http://www.google.com");






Now you can use selenium in your project  which internally uses webdriver .

No comments:

Post a Comment