Nowadays, hundreds of web applications are being built every day. All these applications require some sort of QA testing to perform well. This is where the Selenium suite comes in.
Selenium is an open-source portable testing framework for web applications. Selenium test scripts can be written in different programming languages like python, c++, java, etc. It is a very flexible testing framework for testing functional and regression test cases.
These scripts can be run in most browsers like chrome, safari, firefox, opera, etc., and on platforms like mac0s, windows, and Linux. It supports cross browsing as well as testing on different platforms simultaneously.
The Selenium Suite
Selenium is not just a single app. It contains a suite of tools that work together to provide a good testing experience. The Selenium suite includes:
- Selenium IDE
- Selenium RC
- Selenium WebDriver
- Selenium Grid
IDE (Integrated Development Environment) is a Firefox plugin. It is primarily a run tool used by test developers to develop Selenium Test cases. It allows the tester to record and playback scripts. To create scripts using Selenium IDE, you must use Selenium RC or WebDriver to write advanced test cases.
Selenium WebDriver is what superseded Selenium RC. It is an important member of the Selenium family. It is a browser automation framework which accepts commands and sends them to the browser. The Selenium WebDriver directly communicates with the browser and controls its activities.
Selenium Grid is a smart proxy server used along with Selenium RC. It is used to run testing on different machines on browsers simultaneously. Collectively, it allows multiple testing against different machines simultaneously in different browsers.
Selenium WebDriver Architecture
The Selenium WebDriver cannot be used well without its supporting architecture. We must know about the WebDriver API to understand the Selenium WebDriver Architecture.
The Selenium WebDriver Architecture is a set of open-source APIs that helps communicate between languages and modern web browsers. The architecture consists of four main components, which are:
- Selenium Client Library
- JSON WIRE PROTOCOL over HTTP Client
- Browsers Drivers
Now let's understand each component in detail.
Selenium Client Libraries/Language Bindings
Software testers prefer languages they are comfortable with, and Selenium WebDriver Architecture supports multiple libraries such as Java, C#, Python, Ruby etc. So, specific language bindings are available for anyone with knowledge of any programming language.
JSON WIRE PROTOCOL over HTTP Client
Selenium supports various browsers, each with a separate browser driver. The browser driver communicates with the respective browser and hides the implementation logic from the end-user.
Selenium can run tests on multiple browsers such as Firefox, Chrome, Safari etc. The range of browser support is dependent upon this API.
Let's go over a demo case of using Selenium.
In real-time, you can write code in your UI using any of the supported Selenium client libraries. For example, to create an instance of the Firefox driver, we can use the following commands:
Once you are ready with your test automation scripts, you can click on Run to execute your scripts.
Congratulations, you just tested an app in Firefox using Selenium!
So, that was all about Selenium WebDriver Architecture. Don't forget to click on the subscribe buttons below to stay updated with our latest blogs!