What Is Selenium And What Is WebDriver?
Asked Answered
Z

6

20

What is Selenium?

When you open the official page of the Selenium, the first thing you read is "Selenium automates browser" in "What is Selenium?" section. The section "Which part of Selenium is appropriate for me?" below offers the choice between Selenium WebDriver and Selenium IDE. From this, I deduce that Selenium is a collection of tools and the collection comprises IDE, WebDriver API(language binding), Grid, Selenium Standalone Server, browser driver. One has to download the appropriate ones to build a project.

What is WebDriver?

WebDriver is an API. It is written in more than one language which and they are called language bindings. The API has functions to control a browser. You use the functions in writing a script that controls a browser in the way(test case) you want.

This is what I know. Please correct me wherever I'm wrong. I want to know the answers to the two questions in the interview point of view.

Zeculon answered 31/1, 2019 at 11:34 Comment(0)
T
24

Selenium

Selenium is a free (open source) automated testing suite for web applications across different browsers and platforms. Primarily it is used for automating web applications for testing purposes, but is certainly not limited to just that. Selenium has the support of all of the major browser vendors who have taken (or are taking) steps to make Selenium a native part of their browser. It is also the core technology in countless other browser automation tools, APIs and frameworks.

Selenium is not just a single tool but a set of different software tools each with a different approach to support the test automation of an organization. From a broader perspective previously it had four components as follows:

  • Selenium Integrated Development Environment (IDE)
  • Selenium Remote Control (RC)
  • WebDriver
  • Selenium Grid

An year ago, Selenium RC and WebDriver are merged into a single framework to form Selenium 2.x. Perhaps, Selenium 1 refers to Selenium RC. The current released version is Selenium 3.x.


WebDriver

Selenium-RC worked the same way for each supported browser. It injected javascript functions into the browser when the browser was loaded and then used its javascript to drive the AUT within the browser. Selenium WebDriver fits in the same role as Selenium-RC did and has incorporated the original 1.x bindings and included the WebDriver API. It refers to both the language bindings and the implementations of the individual browser controlling code. This is commonly referred to as just WebDriver. In short, WebDriver is the remote control interface that enables introspection and control of user agents. WebDriver provides a platform and language-neutral wire protocol as a way for out-of-process programs to remotely instruct the behavior of web browsers.

Highlights of WebDriver

  • WebDriver is designed in a simpler and more concise programming interface along with addressing some limitations in the Selenium-RC API.
  • WebDriver is a compact Object Oriented API when compared to Selenium1.0
  • It drives the browser much more effectively and overcomes the limitations of Selenium 1.x which affected our functional test coverage, like the file upload or download, pop-ups and dialogs barrier
  • WebDriver overcomes the limitation of Selenium RC's Single Host origin policy.

Current Implementation

WebDriver is the name of the key interface against which tests should be written in Java/C#/Ruby/Python/NodeJS, the implementing classes which you can use are listed as below:

Tham answered 1/2, 2019 at 15:30 Comment(0)
Q
6

What is Selenium

It is a suite of tools that can be used to automate web browsers testing. Each tool serves different purpose.

List of tools:

  1. Selenium IDE
  2. Selenium RC
  3. WebDriver
  4. Selenium Grid

Selenium RC was merged with WebDriver since Selenium 2

What is WebDriver

Selenium WebDriver is an interface that permits us to execute tests over browsers.

Selenium WebDriver allows us to choose a programming language of your choice to create test scripts.

Please find the image below explaining how exactly WebDriver communicates with the browser :

enter image description here

Quadruplicate answered 18/7, 2020 at 14:1 Comment(0)
M
1

What is Selenium?

Selenium is a framework where scripts are written to run and execute webDriver which in turn controls browser.

What is WebDriver?

WebDriver is an API, the name itself suggests driving the web browser or controlling the web browser by using libraries and commands.

The one and only job of WebDriver is to control the browser, it doesn't know anything about testing and how to interact with browser, At this point FrameWork comes into picture where Scripts are written to run and execute WebDriver.

Malloch answered 17/12, 2020 at 1:12 Comment(0)
B
0

What is Selenium?

You can say it is a web application automation framework.

What is WebDriver?

This is certainly an API but to understand easily you can think it as a library collection.

Bronson answered 1/2, 2019 at 4:57 Comment(0)
C
0

I think it's also worth noting that the WebDriver controls the browser, and that Selenium is the piece that sends/receives method calls and data from/to the driver using the "wire protocol" that the WebDriver creates. So the WebDriver is the bridge from the browser to any other code that wants to communicate with it. Selenium also provides an interface (in the coding sense...) that is standard across different WebDrivers. So when you declare a WebDriver type it is implementing the interface. (This is my current understanding anyway and I'm always learning something new!)

Crouton answered 6/12, 2019 at 18:34 Comment(0)
M
0

Selenium is the collection of APIs that are used to control WebDrivers.

Selenium includes these APIs / language bindings: (Maintained by the Selenium Team)

  • Python
  • Java
  • JavaScript
  • C#
  • Ruby

These are the different types of WebDrivers:

When using Selenium/WebDriver, one would first choose a language binding that they want to use (Eg. Python) and then choose a browser they want to automate (Eg. Chrome / which is controlled by chromedriver).

On top of the language bindings (which provide a basic way of interacting with a WebDriver), there are also Selenium Frameworks that may greatly expand on what the language bindings provide. (For example, if I want to use Selenium with Python, I may want to use SeleniumBase so that I have access to a more powerful API with simplified methods and automatic smart-waiting, which may help me write cleaner, more-reliable tests.)

Although Selenium APIs are the main way that people choose to interact with a WebDriver, WebDrivers also allow for other APIs to interact with them without the use of Selenium. One such example of this is WebDriverIO, which uses WebDriver without using Selenium.

Media answered 23/2 at 17:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.