Selenium WebDriver vs. Selenium RC: A Comparison of Automation Frameworks
Compare and contrast Selenium WebDriver and Selenium RC (Remote Control), highlighting the key differences in their architecture (direct browser interaction vs. server-based communication), performance, and ease of use. This guide helps you choose the most appropriate Selenium framework for your web automation needs.
Selenium WebDriver vs. Selenium RC
Key Differences Between WebDriver and RC
Selenium WebDriver and Selenium RC (Remote Control) are both automation frameworks, but WebDriver is a significant improvement over RC. This comparison highlights the major differences.
1. Architecture
Selenium RC Architecture
Selenium RC uses a server as an intermediary between your test script and the web browser. The process is:
- The RC server starts and injects a JavaScript program (Selenium Core) into the browser.
- Your Selenium commands are sent to the RC server.
- The RC server translates commands into JavaScript instructions and sends them to Selenium Core in the browser.
- Selenium Core executes the instructions in the browser.
- Results are sent back to the RC server, and then to your test script.
This extra layer of communication makes Selenium RC slower and more complex.
Selenium WebDriver Architecture
WebDriver interacts directly with the browser, eliminating the need for an intermediary server. This direct communication makes WebDriver faster and simpler.
The WebDriver architecture requires:
- An IDE (like Eclipse) with a supported language (Java, C#, Python, etc.).
- A web browser (Chrome, Firefox, etc.).
- A WebDriver executable specific to the browser.
2. Speed and Performance
WebDriver is considerably faster than Selenium RC because it eliminates the server communication overhead. The use of JavaScript in Selenium RC also adds to the execution time.
3. Object-Oriented Design
WebDriver is a fully object-oriented API, making it easier to write maintainable and scalable test scripts. Selenium RC is less object-oriented.
4. Mobile Application Testing
WebDriver supports testing on mobile platforms (iOS, Android, etc.), whereas Selenium RC does not.
5. Browser Support
WebDriver supports headless browsers (like HTMLUnit), which allows for faster test execution (no visual browser window needed). Selenium RC requires a real browser instance.