Google+

279. Selenium RC versus Selenium Web Driver






The following are the differences between the Selenium RC and Selenium Web Driver:

Difference 1:

Selenium RC
Selenium Server is required to start.
Explanation:
Selenium RC don't call the browsers directly instead it uses Selenium Server to communicate with the Test Browsers on the same machine or different machine. So we've to start the Selenium Server before running the Selenium RC tests.
How Selenium RC uses Selenium Server ?
Selenium RC works the same way for each supported browser by injecting the JavaScript functions into the browser using Selenium Server when the browser is loaded and also drives the application under test in the browser using Selenium Server (Selenium Server uses Java Script to driver the application under test in the browser).
Drawbacks:
Selenium RC server doesn't use the Browser's built in support for test automation. Hence it has to use Selenium Server as a mediator.
Selenium Web Driver
Selenium Server is not required to start.
Explanation:
Selenium Web Driver makes direct calls to the Test Browsers on the same machine without using Selenium Server as a mediator.
Exception Case:
Selenium  Server will be used as a mediator by Selenium Web Driver when the Selenium Automation tests need be run on a different machine (i.e. While implementing Selenium Grid concept which distributes the Automation tests over multiple machines. This concept may require the Selenium WebDriver to communicate with the test browsers not on the current machine. Hence it uses Selenium Server to communicate with all the test browsers which are not on the current machine.)
How can the Selenium Web Driver make direct calls to the test browsers ?
Selenium Web Driver uses Browser's native support/built in support for test automation. i.e. While writing the Selenium Web Driver automation tests we also use driver code of the browser to be tested. Suppose if we have to run our tests on Firefox Browser, then we will use Firefox Driver code in our Selenium WebDriver automation tests. (Browser Drivers will be explained in the upcoming posts). Hence usage of Selenium Server is not required when the Automation tests and the test browsers are on the same machine.


Difference 2:

Selenium RC
Selenium RC code looks different from the Selenium WebDriver code (Selenium RC uses different commands to perform the operations when compared to Selenium Web Driver )
Selenium Web Driver
Selenium WebDriver code looks different from the Selenium RC code (Selenium Web Driver uses different commands to perform the operations when compared to Selenium RC )


Difference 3:

Selenium RC
Simple and compact API when compared to Selenium Web Driver API.
Selenium Web Driver
Complex and a bit large API when compared to Selenium RC API.


Difference 4:

Selenium RC
Less object oriented API.
Selenium Web Driver
Complete Object Oriented API.


Difference 5:

Selenium RC
Cannot automate to move the mouse cursor using Selenium RC automation
Selenium Web Driver
Can automate to move the mouse cursor using Selenium WebDriver automation.


Difference 6:

Selenium RC
Cannot test iPhone/Android applications
Selenium Web Driver
Can test iPhone/Android applications.








Please comment below to feedback or ask questions.

Create a JUnit Selenium Web Driver test using Selenium IDE  will be explained in the next post.



No comments: