Selenium was initially published in the mid-2000s as a Web browser plugin for recording and replaying Web browser interactions. Since then, it has undoubtedly become the most used test automation tool. According to a study of the automated testing community, the framework is utilized by more than 80% of those polled.
- Selenium is an open-source framework for Web-based application automation, including Selenium WebDriver, Selenium IDE, and Selenium Grid.
- Selenium IDE is a browser plugin that captures and replays user interactions.
- Selenium Grid enables WebDriver to simultaneously execute automation tests on many computers, browsers, and OS systems.
Selenium is frequently utilized in the software automation sector due to the benefits it gives. First, it is developer-friendly, enabling developers to build and test any programming language of their choosing. Second, the framework is a cross-browser and cross-operating system, allowing teams to perform test automation across several browsers and operating systems.
The Selenium WebDriver architecture is made up of three parts: the WebDriver, the Browser Specific Drivers or Drivers, and the Browser. These components communicate bidirectionally or two-ways, issuing HTTP requests and receiving HTTP replies in RESTful services.
Browser Specific Drivers, also known as Drivers, are responsible for running the actual Browser via delivering WebDriver requests. Drivers can be implemented and extended by third parties. Two browser driver implementations are GeckoDriver for Firefox and ChromeDriver for Chrome.
Browser component accepts requests from the Drivers component to drive interactions on the application under test (AUT). Selenium is compatible with all major browsers, including Chrome, Firefox, Internet Explorer, Opera, and Safari.
WebDriver can operate on a separate system than the Drivers and Browser components. In this configuration, WebDriver connects with these components remotely through Selenium Server or Remote WebDriver. Selenium can now perform automated tests on many browsers and computers seamlessly at the same time.
The architecture is disjointed. Three components connect using the HTTP protocol and RESTful Web services as the mode of communication. This property enables an element to function independently of the others. Changes and improvements to one component may be performed quickly and without impacting the others. Selenium may be platform- and language-neutral thanks to its loosely linked design.
Moreover, the architecture is accessible. Selenium WebDriver is a W3C Recommendation, which allows for many contributions from the software community.
These architectural characteristics result in a spate of significant Selenium characteristics:
- Cross-platform and cross-language compatibility. Because several implementations of the Drivers component are available, users may run automation scripts on various operating systems and browsers. As long as language bindings in the WebDriver are accessible, Selenium automation scripts may be developed in various languages.
- Developer friendly. Because Selenium supports various languages, developers may build automation scripts in their preferred language. They may also create and incorporate a binding library in the WebDriver component to help a new scripting language if necessary.
- Open for extension. The Selenium architecture allows for language binding expansions by supporting additional test scripting languages or Drivers for new browsers.
- Open for integration with a test automation framework. A new test automation framework may be constructed on top of Selenium by utilizing it as an engine for executing scripts for Web automation, as demonstrated in the figure below.
When viewed through the eyes of individuals who do not possess programming or sophisticated technical abilities, Selenium's advantages in assisting programming are really its drawbacks. Many testers see Selenium as a barrier to getting started with test automation due to complex programming. As a result, using Selenium directly presents a high learning curve for many testers.
Selenium also lacks means for separating automation scripts from test data, resulting in high test script maintenance costs and difficulties with test script and test data reusability. There is also a deficiency in managing and organizing test materials such as test scripts, data, and test objects.
These restrictions help to explain the rapid rise of Selenium-based products in the software test automation industry in recent years. Teams and companies want a solution that provides out-of-the-box testing capabilities without requiring them to develop their own Selenium-based framework to start their automation process.
On top of Selenium, a variety of test automation frameworks have been developed. These frameworks attempt to solve several of Selenium's shortcomings, such as the absence of modules for reporting, logging, monitoring, and reusing test automation assets. Importantly, these frameworks aid in overcoming the challenge of developing and launching an automation effort with Selenium.
The diagram below presents various components of a typical test framework that uses Selenium as its test execution engine.
Many current automation solutions use this Selenium-based framework. Some examples are Katalon Studio, CrossBrowserTesting, QMetry Automation Studio, Lambda Test, and Sauce Labs. Many of these solutions go a step further by incorporating Appium as a test automation engine for mobile apps, allowing them to handle both web and mobile automation in a single tool.
Resource: A Deep Dive into Selenium, Its Alternative Solution for 2021 and Beyond
Top 3 Selenium IDE Alternative
Also Katalon are introduce how to migrate from Selenium