What is Selenium WebDriver?
WebDriver is developed to overcome the limitations in the Selenium-RC API. Selenium WebDriver is a cross-platform testing framework that allows you to execute your tests against different browsers like Mozilla Firefox, Google Chrome, InternetExplorer, Safari, Opera, GhostDriver, etc. It is a programming interface to create and run test cases. It does not require a core engine like Selenium RC and interacts natively with the browser applications. Selenium WebDriver speaks directly to the browser using browser drivers for a particular browser.
Selenium WebDriver supports the following languages
Difference between Selenium RC and WebDriver
Let us discuss how Selenium RC and WebDriver differ each other
Selenium WebDriver’s architecture is simple than Selenium RC’s.
- It controls the browser from Operating System-level
- All you need are your programming languages IDE and a browser
Selenium RC’s architecture is more complicated than WebDriver
- You first need to install and launch a separate application called Selenium Remote Control Server before you start running test scripts
- The Selenium RC Server acts as a mediator between your browser and your Selenium commands
The following operations are performed behind the scenes when you run your tests scripts in Selenium RC:
- Once the Selenium Core is injected it will start receiving instructions from the RC server based on test scripts
- The web browser will execute all the commands of Selenium Core and returns its response to the RC Server.
- The RC Server will receive the browser response and then display the results.
Selenium WebDriver scripts execution is faster than Selenium RC since it speaks directly to the browser using browser drivers for a particular browser.
3. Real-life Interaction
Selenium WebDriver communicates with elements the page in a more realistic way. For example, if you have disabled dropdown on a webpage you are testing, WebDriver cannot select any value in it just like how a real person can’t do.
Selenium RC is less object-oriented API, whereas Selenium WebDriver is purely object-oriented API. Selenium WebDriver is purely based on object-oriented programming languages like C#, Java, Python, etc. Selenium RC has weak API, whereas WebDriver has Strong API.
5. Browser Support
Selenium WebDriver can support a headless HTMLUnit browser. The term Headless refers to an invisible browser written in java. It can be configured to simulate a specific browser. It is a very fast browser because of no need to wait till the time in waiting for page elements to get loaded.
Selenium RC cannot support the headless HtmlUnit browser. To operate it needs a real, visible browser.
Advantages of Selenium WebDriver over Selenium RC
Limitations of WebDriver
- Selenium doesn’t support windows based applications.
- By alone Selenium tool cannot test mobile applications, we can achieve it with the help of Appium.
- By alone Selenium tool cannot test Windows-based popup, we need to use AutoIT tool to handle the windows based popups
- Selenium uses JUnit/ TestNG for reporting since selenium doesn’t have inbuilt reporting capability.
- Selenium doesn’t have an in-built object repository.
- No reliable support is available because of an open-source.
- Selenium doesn’t support to perform testing on images, we need to use Sikuli for image-based testing.
Selenium RC has In-built Test Result Generator
Selenium RC mechanically generates an HTML file to test results. RC by itself sets the report format.
Selenium WebDriver has no in-built command to generate a Test Results File automatically. You have to depend on your IDE’s output window or you need to design the report by yourself by using the programming language capabilities.
- Due to simpler architecture, Selenium WebDriver is faster than Selenium RC
- Selenium RC cannot support HtmlUnit browser like WebDriver
- Selenium RC takes the help of RC Server to talks to the browser, where WebDriver talks to the browser directly.
- WebDriver is a tool used for testing web-based applications across multiple browsers with different programming languages.
- Selenium WebDriver’s API is briefer than Selenium RC’s.
- WebDriver cannot readily support new browsers like Selenium RC.
- WebDriver does not have an in-built command for automatic test results generation.
Note: The Selenium RC is no way used in the current market, it is completely deprecated.