For my next project, I had to evaluate selenium remote control (a.k.a Selenium RC 1.0) and selenium webdriver (a.k.a., Selenium 2.0). The automation framework uses selenium core, which is a firefox extension, and hence supports only firefox browser. The goal is to upgrade the framework to use next version of selenium with minimal changes to the test scripts and picking up maximum new features of latest selenium, like multi-browser support, etc.
Here is the comparison
Selenium Remote Control
Selenium RC model consists of Selenium remote control server and selenium client libraries. Below is the architecture diagram (from seleniumhq.org). The test script is written using selenium client libraries. The selenium client libraries talk to the selenium remote control server, which will run the command on the browser specified by the test, gets the result from the browser and passes the result to selenium client.
Selenium RC server is a java jar file. Selenium RC server listens on a port (default is 4444) to receive the commands from the selenium client and passes it to the browser using selenium core JavaScript commands. Browser runs the command received using its JavaScript interpreter and returns the result to the Selenium RC server. The selenium RC server then reports back the result to the Selenium Client.
Selenium Client are the interfaces between the test script and the selenium remote control server. The selenium client are available in multiple languages, allowing the users to write the tests in their favorite language. The Client Driver is available in languages such as C#, Java, Perl, PHP, Python, Ruby.
Limitations of the Selenium RC
- Since Selenium RC model, internally works with JavaScript, lot of limitations are imposed by the browsers in order to protect user from malicious script. For example using Selenium RC one cannot navigate between the domains.
- Selenium RC always requires a real browser, whereas using WebDriver, one can test the application using simultated browsers like HtmlUnit.
Selenium WebDriver
Selenium WebDriver is the current version of Selenium 2.0. It provides many new features and improvements over Selenium 1.0. In the Selenium WebDriver model, there is no intermediate server to send the commands to the browser. Selenium WebDriver includes Selenium WebDriver API, which directly call the native functionality of the respective browser. This means if the test script is completely using Selenium WebDriver API there is no need to use Selenium RC server. However the package (selenium-standalone-server-version.jar) comes with both Selenium WebDriver and Selenium RC
However for backward compatibility, user can use Selenium-backed WebDriver (WebDriver API but with back-end selenium technology), for which Selenium Server (RC) is required.
Limitations of WebDriver
- Since Selenium WebDriver directly interacts with browser’s native functionality, only a subset of browsers from those supported in Selenium RC are supported currently.
- Selenium WebDriver API is currently available in Java, Python, C# and Ruby. Selenium officially has removed support for Perl and PHP, but there are third party drivers available for the languages.