Selenium - Remote Control
Selenium - History (RC vs WebDriver)
Section titled “Selenium - History (RC vs WebDriver)”Selenium Remote Control (RC) - The Predecessor
Section titled “Selenium Remote Control (RC) - The Predecessor”Selenium Remote Control (RC), also known as Selenium 1, was the flagship Selenium project for many years before the advent of Selenium WebDriver (Selenium 2, 3, and 4).
RC worked by injecting JavaScript code (Selenium Core) into the browser. Test scripts, written in languages like Java, C#, Python, etc., communicated with a separate Selenium RC Server. This server acted as a proxy, translating commands from the test script into JavaScript instructions, sending them to the browser, and returning results.
RC Architecture Limitation
Section titled “RC Architecture Limitation”The RC architecture involved an intermediary server and relied on JavaScript injection. This approach had several limitations:
- Slower Execution: The extra communication hop through the RC server added latency.
- JavaScript Sandbox Restrictions: Selenium Core was limited by the browser’s JavaScript security model, making some interactions difficult or inconsistent.
- Less Realistic Interactions: Actions were simulated via JavaScript rather than native browser events.
- Complex Setup: Required running a separate server process.
The Rise of WebDriver
Section titled “The Rise of WebDriver”Selenium WebDriver was developed to overcome RC’s limitations. WebDriver communicates directly with the browser using the browser’s native automation support (via a specific driver executable for each browser - ChromeDriver, GeckoDriver, etc.).
WebDriver Advantages
Section titled “WebDriver Advantages”- Direct Communication: No intermediary server needed between the script and the browser driver.
- Faster Execution: Reduced latency leads to quicker test runs.
- Native Events: Interacts with the browser more directly, resulting in more realistic user simulation.
- Improved API: Offers a more modern, object-oriented, and consistent API.
- Better Handling of Dynamic Pages: More robust mechanisms for dealing with AJAX and dynamic content (Waits).
Conclusion: RC is Deprecated
Section titled “Conclusion: RC is Deprecated”Selenium RC is officially deprecated and no longer actively supported. All new Selenium test automation development should use Selenium WebDriver.
While you might encounter RC in legacy projects, understanding its history helps appreciate the advancements brought by WebDriver, which is the current standard and the focus of this tutorial.