Showing posts with label Difference between Selenium RC and Selenium WebDriver. Show all posts
Showing posts with label Difference between Selenium RC and Selenium WebDriver. Show all posts

Tuesday, September 25, 2018

Difference between Selenium RC and Selenium WebDriver

Hi guys, In this post, I am going to cover -

  • What is Selenium RC.
  • Different components of RC.
  • How RC works?
  • Evolution of WebDriver.
  • WebDriver VS RC.


Selenium RC





Selenium RC is also known as Selenium 1.0.

It has two components -

  1. Selenium remote control server.
  2. Client Library.

1. Selenium RC server 

Selenium RC server acts as a middleman between selenium commands and browsers. Selenium Server receives Selenium commands from test scripts, interprets them, and reports back the results of running those scripts.
2. Client Library
It provides a programming interface between each programming language and RC server. We need a programming language to create test script which has a set of selenium commands. Client Library provides a programming interface(API) which is nothing but a set of functions, which runs selenium commands from your own test script. There is a different client library for each of the supported programming languages.

How RC works?
  1. First, you write the test script.
  2. Before you start running the script, you need to start selenium RC server.
  3. The server will inject a JavaScript program called  Selenium core.
  4. Selenium Core is a JavaScript program. It is actually a set of JavaScript functions which interprets and execute selenium commands based on the browser's inbuilt JavaScript interpreter.
  5. Once you start running the script, the client library takes selenium commands one by one and passes it to the server.
  6. Server now passes the commands in the form of instructions to the selenium core.
  7. Selenium core executes them as JavaScript commands.
  8. The browser will obey the instructions of the selenium core and actions will be performed on the AUT(APPLICATION UNDER TEST).
  9. Based on the actions performed, browser relays its response to the server.
  10. The server then passes the response to the client library.
  11. Client library passes the response back to the script.
  12. Now script receives the response and can store it in a variable and report it as a success or failure.
https://automation-seleniumtutorial.blogspot.com/2018/09/difference-between-selenium-rc-and.html

So, one can observe that the writing script in RC and executing it is how much complex. The notable thing is the use of the server as a middleman. This makes the execution of script slow and hence performance.



Here comes the WebDriver!!!
Selenium 2.0 is also known as WebDriver.

How WebDriver works?

No concept of Server.
Yes, you don't need to start any server. A BIG relief!!!

It controls the browser from the OS level.
All you need are your programming language IDE(most of the case Eclipse) and browser to perform testing.


Now we will see the difference between Selenium RC and Selenium WebDriver -





  1. Speed-  As I discussed above, Selenium RC requires the server to execute test scripts across browsers. But, Webdriver makes a direct connection with the browsers. Thus, Webdriver improves the performance of execution speed as compared to RC.
  2.  Interaction with web page elements - Suppose, there is a web element which is disabled on the web page. If a user tries to enter something, then what is the expectation? Definitely, the user will not be able to enter anything in a disabled web page element. This is how Webdriver interacts with the page elements. It provides a realistic interaction with them. But this is not the case in RC. Selenium core like other javascript code can enter a value in the disabled text box(a web page element) also. In the past, many selenium testers complained about this weird behavior.
  3. API - Webdriver' API is more concise in comparison to RC's API. RC's API contains redundancies and confusing commands. User often get confused which commands to use type() or types(), click() or  mouseDown() or mouseDownAt(). Apart from that, the different browser interprets each of these commands in different ways too. Well, this is not the case in Webdriver. We have click() command for clicking, sendKeys() for entering or typing some data.
  4. Support for the browser - RC does not provide support for HTMLUnit browser. It a  headless browser because it is invisible that means NO GUI
  5. Customised reporting feature - Selenium RC has a feature to provide HTML based report details of all the executed test cases. But Webdriver does not provide such kind of feature.
  6. New browser support - As we know that Webdriver operates on OS level and there is a separate driver provided for each supported browser. Each Browser communicates with the OS in its own way. In such a scenario, if a new browser is released, then definitely it will also have its own way of communicating process with OS and also we won't have a separate driver for it too. So it is totally dependent on Webdriver's team when they will release a separate driver or whether they will provide any support for this new one or not.
This is all about Selenium RC and a quick difference between Selenium RC and Selenium WebDriver. In my next post, I will discuss WebDriver and how to configure WebDriver jar file with Eclipse.




Guys, do comment in the comment box and share your views about the post. If you have any query, please comment on it. It will help me to reach to you and help you to resolve your query.