What is Selenium? Selenium WebDriver Architecture

What is Selenium? Selenium WebDriver Architecture

In this article, we are going to discuss the basics of Automation Testing, its benefits, Different components of selenium web-driver and Selenium architecture.

What is Automation Testing?

Test Automation or Automation testing or is a process of automating the manual process to test the application/system under test. Automation testing involves use to a separate testing tool which lets you create test scripts that can be executed repeatedly and doesn’t require any manual intervention.



Benefits of Automation Testing

1. Supports execution of repeated test cases 
2. Aids in testing a large test matrix 
3. Enables parallel execution 
4. Encourages unattended execution 
5. Improves accuracy thereby reducing human-generated errors 
6. Saves time and money 

What is Selenium


Selenium is one of the most popular automated testing suites. Selenium is designed in a way to support and encourage automation testing of functional aspects of web-based applications and a wide range of browsers and platforms. Due to its existence in the open-source community, it has become one of the most accepted tools amongst the testing professionals.

Different components of Selenium


Selenium is not just a single tool or a utility, rather a package of several testing tools and for the same reason, it is referred to as a Suite. Each of these tools is designed to cater to different testing and test environment requirements. 
The suite package constitutes of the following sets of tools: 

Selenium Integrated Development Environment (IDE) – Selenium IDE is a record and playback tool. It is distributed as a Firefox Plugin. 

Selenium Remote Control (RC) – Selenium RC is a server that allows the user to create test scripts in the desired programming language. It also allows executing test scripts within the large spectrum of browsers. 

Selenium WebDriver – WebDriver is a different tool altogether that has various advantages over Selenium RC. WebDriver directly communicates with the web browser and uses its native compatibility to automate. 

Selenium Grid – Selenium Grid is used to distribute your test execution on multiple platforms and environments concurrently. 



Few of the major differences between all these Selenium RC, Webdriver and Selenium Grid are:

Feature
Selenium IDE
Selenium RC
WebDriver
Browser Compatibility
Selenium IDE comes as a Firefox plugin; thus it supports only Firefox
Selenium RC supports a varied range of versions of Mozilla Firefox, Google Chrome, Internet Explorer and Opera
WebDriver supports a varied range of versions of Mozilla Firefox, Google Chrome, Internet Explorer and Opera. It also supports HtmlUnitDriver which is a GUI less or headless browser.

Record and Playback
Selenium IDE supports record and playback feature
Selenium RC doesn't support record and playback feature
WebDriver doesn't support record and playback feature
Server Requirement
Selenium IDE doesn't require any server to be started before executing the test script.
Selenium RC requires the server to be started before executing the test scripts.

WebDriver doesn't require any server to be started before executing the test scripts.

Architecture
Selenium IDE is a Javascript-based framework
Selenium RC is a JavaScript-based Framework
WebDriver uses the browser's native compatibility with automation.

Object Oriented
Selenium IDE is not an object-oriented tool
Selenium RC is semi object-oriented tool
WebDriver is a purely object-oriented tool.

Dynamic Finders (for locating web elements on a webpage)

Selenium IDE doesn't support dynamic finders
Selenium RC doesn't support dynamic finders
WebDriver supports dynamic finders
Handling Alerts, Navigations, Dropdowns
Selenium IDE doesn't explicitly provide aids to handle alerts, navigations, dropdowns
Selenium RC doesn't explicitly provide aids to handle alerts, navigations, dropdowns
WebDriver offers a wide range of utilities and classes that helps in handling alerts, navigations, and dropdowns efficiently and effectively.

WAP (iPhone/Android) Testing
Selenium IDE doesn't support testing of iPhone/Andriod applications
Selenium RC doesn't support testing of iPhone/Andriod applications
WebDriver is designed in a way to efficiently support testing of iPhone/Android applications. The tool comes with a large range of drivers for WAP-based testing. For example, AndroidDriver, iPhoneDriver.

Listener Support
Selenium IDE doesn't support listeners
Selenium RC doesn't support listeners
WebDriver supports the implementation of Listeners.

Speed
Selenium IDE is fast as it is plugged in with the web-browser that launches the test. Thus, the IDE and browser communicates directly
Selenium RC is slower than WebDriver as it doesn't communicate directly with the browser; rather it sends selenese commands over to Selenium Core which in turn communicates with the browser.
WebDriver communicates directly with web browsers. Thus, making it much faster.


Selenium WebDriver Architecture






On a high level we can say selenium Web-driver architecture consists of these four layers:

    1.  Language binding: 
To provide the support for multiple programming languages multiple language binding has been created like Java, Python, Ruby, etc.



2.  Selenium Web driver: 
To communicate between multiple programming languages and browsers, Selenium web-driver API is used. It follows all the OOPS concepts like inheritance, Polymorphism, etc.

3.  Browser drivers: 
Browser driver is used to communicate with the browser without showing the internal functionality or logic of the browser.

4.  Browsers:
Selenium supports multiple browsers such as Firefox, Chrome, IE, Safari, etc.


To understand architecture in simple terms

ü  Whenever we execute a certain piece of code every statement in the code will be converted into a URL with the help of selenium web-driver API.
ü  This URL then will be passed over to the browser driver.
ü  The client library like java, C# will convert the statements into JSON format and further communicate with the web browser.






SHARE THIS

Author:

My Name is Ankur Jain and I am currently working as Automation Test Architect.I am ISTQB Certified Test Manager,Certified UI Path RPA Developer as well as Certified Scrum Master with total 12 years of working experience with lot of big banking clients around the globe.I love to Design Automation Testing Frameworks with Selenium,Appium,Protractor,Cucumber,Rest-Assured, Katalon Studio and currently exploring lot in Dev-OPS as well. I am currently staying in Mumbai, Maharashtra. Please Connect with me through Contact Us page of this website.

Previous Post
Next Post