DEV Community

Cover image for So now,What is Selenium? and why do we need to use Selenium
AeroSiva
AeroSiva

Posted on

So now,What is Selenium? and why do we need to use Selenium

So what is Selenium?

In short, Selenium is a suite of tools for automating web browsers. It remotely controls browser instances and emulates the user’s interaction with the browser. It allows users to simulate common activities performed by end users;
Enter fullscreen mode Exit fullscreen mode
  1. Entering text in the field.
  2. Selecting dropdown values.
  3. Checking check boxes.
  4. Clicking links in the documents.
  5. Mouse movements.
  6. Execution of arbitrary JavaScript, Etc.

Who uses Selenium?

The companies are using it for browser-based tests for functional test automation.

Let us discuss about Short history of Selenium

.
In Chicago Jason Huggins works in Thoughtworks consultancy, Where automatic testing of any application was done on Agile methodology. There he built a core of selenium mode as “JavaScript Test Runner” for testing an internal Time and Expenses application Plone._ Plone_ is a ready-to-run content management system, that offers a complete set of features needed by various organizations. When he shares it with his colleague it grows into what we see now due to its usage and contribution of many coders. Later initial development Shinya Kasatani in Japan wrapped the core into an IDE module in the Firefox browser to record tests and played it back to develop Selenium IDE. In 2007, With the support of Google Selenium RC and Selenium Grid, it gained much development. _Simon Stewarts _at Thoughtworks Web testing tool called WebDriver and Jason’s Selenium project was merged into get better selenium as of today.

Why Do we need to use SELENIUM ? First, let us understand various Test-Tool Suites.

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

Selenium IDE.

• It is an easy-to-use browser extensions like

  1. Google’s – Chrome/Chromium.
  2. Mozilla’s - Firefox.
  3. Microsoft – Edge • Generally, it is the most efficient way to develop a test case. Developed by Shinya Kasatani from Japan. • It records the User’s actions in the browser using existing Selenium controls with parameters defined by the context of that element.

Selenium WebDriver.

• At the core of selenium is the WebDriver, an interface to write instruction sets that can be run interchangeably in many browsers.
• WebDriver uses browser automation APIs provided by browser vendors to control the browser and run tests. This is as if a real user is operating the browser.
• API-Application programming Interface is the set of commands used to manipulate WebDriver.
• WebDriver passes commands to the Browser through the Driver and gets information back via the same path.
• Driver – Responsible for controlling the actual browser and is specific to the Browser such as

  1. ChromeDriver for Google Chrome.
  2. GeckoDriver for Mozilla Firefox.

These Drivers are generally executable modules that run on the system within the browser itself and not in the system executing the test suite.
• Tests may or may not be executed in the same system.

WebDriver sends commands to Driver and Driver sends commands to Browser,While the Browser sends back information to the Driver and Driver inturn sends the information to the WebDriver

Selenium RC
• It is now WebDriver.
• It supports various languages like Python, PHP, C#, etc.

WebDriver sends commands to the Remote driver and it send commands to the Driver and Driver sends commands to Browser,While the Browser sends back information to the Driver and Driver inturn sends the information to the Remote driver which inturn sends information to the WebDriver

Selenium Grid

• After the development of the WebDriver tests, one may need to run tests on multiple browsers and operating system combinations.
• It is used to run test cases in different machines across different platforms.
• The control on triggering the test cases is on the local end, an when the test cases are triggered, they are automatically executed by the remote end.

WebDriver sends commands to the Selenium server/Grid and it send commands to the Driver and Driver sends commands to Browser,While the Browser sends back information to the Driver and Driver inturn sends the information to the Selenium server/Grid which inturn sends information to the WebDriver

Framework

An additional library is used as a support for WebDriver suites. This framework matches the language bindings.
Enter fullscreen mode Exit fullscreen mode
  1. Junit for Java.
  2. Nunit for .NET.
  3. RSpec for Ruby.

The test framework is responsible for running and executing WebDriver and related steps in tests. Natural language frameworks /tools such as Cucumber may also exist as part of that Test framework box.


WebDriver sends commands to the Selenium server/Grid and it send commands to the Driver and Driver sends commands to Browser,While the Browser sends back information to the Driver and Driver inturn sends the information to the Selenium server/Grid which inturn sends information to the WebDriver and in this whole process WebDriver is placed within the Test Framework

Top comments (0)