What is the difference between Selenium WebDriver and Selenium RC?

Selenium is a popular automation testing framework that is primarily used for web application testing. It offers a way for developers to write tests in various programming languages like Java, C#, Python, etc. There are two major components of Selenium - Selenium WebDriver and Selenium RC (Remote Control).

Selenium WebDriver

Selenium WebDriver is a web-based automation testing framework which can test web pages initiated on various web browsers and various operating systems. In fact, you also have the freedom to write test scripts in different programming languages like Java, Perl, Python, Ruby, C#, PHP and JavaScript. Do note that JavaScript is used for pop-up windows and not for writing a complete test script.

Selenium RC

Selenium RC, also known as Selenium Remote Control, was the flagship testing framework of the whole Selenium project for a long time. It is the first automated web testing tool that allowed users to use a programming language they prefer.

The Differences

  1. Architecture: Selenium RC's architecture is more complex than WebDriver. In RC, the Selenium RC Server acts as a mediator between the browser and your Selenium commands. This is because the JavaScript sandbox in which Selenium Core is running has restrictions that prevent it from doing certain things. Selenium RC Server bypasses the Same Origin Policy, which is a security feature in all browsers. On the other hand, WebDriver interacts directly with the browser without the need for a server. This makes WebDriver faster than RC.

  2. Speed: As mentioned above, WebDriver is faster than RC since it interacts directly with the browser.

  3. API: WebDriver's API is simpler than RC's. WebDriver's API also has better support for page navigation and handling AJAX-based sites.

  4. Real-life Interaction: WebDriver interacts with page elements in a way that is closer to how a human would, for instance, if a particular element is not visible on screen, WebDriver won’t be able to interact with it, just like a human.

  5. Support: Selenium RC is officially deprecated. This means that there won't be any more updates or bug fixes for RC. WebDriver is currently supported and actively maintained.

  6. Browser Support: WebDriver supports a larger range of web browsers and their versions as compared to Selenium RC.

While both Selenium RC and WebDriver are used for the same purpose, they differ in the way they interact with the browser, their speed, API, and the kind of support they receive. WebDriver is generally considered superior due to its simpler interface and speed. However, some developers may still need to maintain and update their existing test scripts that use Selenium RC.

Related Questions

Get Started Now

WebScraping.AI provides rotating proxies, Chromium rendering and built-in HTML parser for web scraping
Icon