So now,What is Selenium? and why do we need to use Selenium
Tags: automation, automationtesting, testing, selenium
Published: 2023-10-02 02:56:36

## 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;
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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6bsuca1qpvbb7xusoeb0.png)

**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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z6xtifwmrs3mqmm13bj6.png)

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/12u164la3z86nx6pke5e.png)

## Framework
	An additional library is used as a support for WebDriver suites. This framework matches the language bindings.
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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jaakbed2gpe7wybf0cwq.png)