33

I can see that since selenium 2.0, WebDriver and Selenium RC are packaged together for download. Now I primarily use WebDriver, but can I bring in Selenium RC in my testing scripts from now and then? Is there anything that Selenium RC is capable of but WebDriver is not, or vice versa?

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
zihaoyu
  • 5,483
  • 11
  • 42
  • 46

3 Answers3

38

You should probably start your research here (though you may have already gone over this): http://seleniumhq.org/docs/03_webdriver.html

I'll assume you're contrasting Selenium-RC to WebDriver, Selenium-IDE really isn't in the same ballpark.

Selenium uses JavaScript to automate web pages. This lets it interact very tightly with web content, and was one of the first automation tools to support Ajax and other heavily dynamic pages. However, this also means Selenium runs inside the JavaScript sandbox. This means you need to run the Selenium-RC server to get around the same-origin policy, which can sometimes cause issues with browser setup.

WebDriver on the other hand uses native automation from each language. While this means it takes longer to support new browsers/languages, it does offer a much closer 'feel' to the browser. If you're happy with WebDriver, stick with it, it's the future. There are limitations and bugs right now, but if they're not stopping you, go for it.

Selenium Benefits over WebDriver

  • Supports many browsers and many languages, WebDriver needs native implementations for each new language/browser combo.
  • Very mature and complete API
  • Currently (Sept 2010) supports JavaScript alerts and confirms better

Benefits of WebDriver Compared to Selenium

  • Native automation faster and a little less prone to error and browser configuration
  • Does not require Selenium-RC Server to be running
  • Access to headless HTMLUnit can allow tests to run very fast
  • Great API
Ralph Willgoss
  • 11,750
  • 4
  • 64
  • 67
pnewhook
  • 4,048
  • 2
  • 31
  • 49
  • Are they merging since 2.0? I downloaded selenium-java-2.0a4.jar. It has org.thoughtworks.selenium.Selenium for Selenium and org.openqa.selenium.WebDriver for WebDriver. Now I am using WebDriver most of the time. But once a while I want to use selenium just to click JS alerts and confirms. Is this possible? I mean is it possible to extract some sort of Selenium object from a WebDriver object? – zihaoyu Sep 02 '10 at 15:17
  • Correct, they're merging as of 2.0. Take a look at the Selenium Docs to see how to use Selenium from WebDriver http://seleniumhq.org/docs/09_webdriver.html#emulating-selenium-rc – pnewhook Sep 02 '10 at 17:27
  • 2
    Correction to the URL. The one above is out of date. It is now: http://www.seleniumwiki.com/software-testing/selenium-rc-vs-webdriver/ – Screamer Oct 17 '11 at 15:38
  • 3
    Be nice to cite the source: http://www.seleniumwiki.com/software-testing/selenium-rc-vs-webdriver/ – Nix Apr 02 '12 at 15:05
  • Selenium Remote Control is deprecated – ubershmekel Feb 07 '13 at 17:22
  • @Nix, you'll notice the wiki (which is a private website, not the official docs) is dated after this entry. – pnewhook Feb 07 '13 at 19:43
  • Simply, WebDriver (Selenium 2) is the successor of Selenium RC. – Ripon Al Wasim Aug 17 '15 at 04:29
17

I see this is an old question but found this is on the Selenium HQ home page:

Selenium WebDriver is the successor of Selenium Remote Control which has been officially deprecated. The Selenium Server (used by both WebDriver and Remote Control) now also includes built-in grid capabilities.

So it's settled :-)

ubershmekel
  • 11,864
  • 10
  • 72
  • 89
Screamer
  • 1,141
  • 10
  • 13
2

The biggest difference is RC runs from a vs, 2.0 uses Webdriver and launches the browser, instead of using a vs. In order to you RC in 2.0, check here: http://seleniumhq.org/docs/09_webdriver.html#emulating-selenium-rc

I dont know how to take 2.0 into RC though, but were do you see they are packaged together? They are two different products. Selenium 2 is webdriver, and Selenium RC is Selenium 1.

Personally, I found 2.0 a lot easier to program with. Plus by the end of the year Javascript alert support should be implemented, which is a huge plus!

James
  • 5,622
  • 9
  • 34
  • 42
  • I mean they are packaged in a .zip for download. Of course two different packages (org.thoughtwork.selenium.Selenium and org.openqa.selenium.WebDriver). It is sad to hear that JS alert is not supported by now, which is related to my another question (http://stackoverflow.com/questions/3613584/webdriver-dismiss-a-alert-box). – zihaoyu Sep 01 '10 at 16:08
  • The link is now dead. – Dan Dascalescu Aug 05 '15 at 23:36