Updated April 8, 2023
Introduction to Components of Selenium
The four components of Selenium are Selenium Grid, Selenium RC, Selenium Web Driver, and Selenium IDE. In plain words, Selenium IDE is a simple framework used as a Mozilla Firefox browser plugin. Selenium RC is known as the Selenium 1 tool used for JavaScript-based automation. Selenium Driver is known as the Selenium 2 used for automation programming specific to a browser. And Selenium Grid is used along with Selenium RC for parallel processing of multiple automation test scripts at the same time
Components of Selenium
As discussed earlier, the four components are as below:
- Selenium IDE
- Selenium RC
- Selenium Web driver
- Selenium GRID
Let us have a look at these in detail.
1. Selenium IDE
- This is the simplest suite present in the Selenium suite. Selenium IDE allows to record and playback of the scripts. It is implemented using the Firefox extension. By using Selenium, you can record, edit and debug different tests. The tests created can be easily organized by having different tests in different suites. The record and playback functionality helps in prototyping the tool and provides the ease of learning. It acts as an overall solution for developing and maintaining different suites.
- Having basic knowledge about HTML, JavaScript and DOM can help the tester in utilizing the best of Selenium IDE. When the tester creates test cases it provides a feature of auto-completing these. This helps in entering commands quickly and saves time. It also reduces the chances of entering invalid commands.
With all these there are some additional features of Selenium as below:
- It has an easy record and playback mechanism.
- It has the option of automatically asserting the title of every page.
- It provides the facility of autocomplete for all frequently used commands.
- It provides debugging options with set breakpoints.
- Selenium supports user extensions like .js file.
- It makes use of intelligent field selection which will make use of IDs, names or XPath as required.
If the user is aware of the basics of HTML, DOMs, JavaScript then it is easier to create numerous scripts that can ease the testing process.
2. Selenium RC
- Selenium Remote Control is a testing tool which helps in writing test scripts for web-based applications in any programming language. It has two parts to it. First is the one which launches and kills browsers. This server acts as an HTTP proxy server for different web requests. It also supports different client libraries. Selenium RC is the first tool that provided support for different programming languages like Java, Ruby, Perl, PHP, etc. In Selenium it is required to start the Selenium server before the tester starts the execution. The Selenium server kills the browsers and runs Selenese commands which act as an HTTP proxy and intercepts messages.
- This server acts as a mediator between the code and the browser. The commands are sent to the server and they interpret the commands which in turn are converted to JavaScript and this JavaScript is then injected to the browser. Once this is done then the browser can execute the JavaScript and send the response to the server. The browser now interprets the command and will return the code in the respective language from which it was converted. Selenium RC also supports parallel execution of different test cases as it supports Selenium Grid.
3. Selenium Web driver
- Web Driver is the extension of Selenium RC. It supports all the latest browsers and different platforms. There is no need of the Selenium server being started before starting the execution of different test scripts. Selenium Web driver does not require JavaScripts. It was developed in order to support dynamic web pages where any elements which will be present on the page can change without having the page to be reloaded. It provides a properly designed API that provides improved support for modern web testing applications. Web driver is created in a way which directly calls the browser by using the native support for automation.
- Selenium server depends on the intention of using the Web driver. If the browser and test cases are to run on the same machine, then there is no need to run the Selenium server. Web driver will run directly. You can use Selenium Grid to segregate the tests over multiple machines and virtual machines. Selenium server would be required when the tester is connecting remotely or through a particular browser.
- The web driver interface declares different methods that can be used for end to end testing. The test class which is created should be used in the browser-specific implementation. This test class can control web browser and also select different elements which can be loaded from HTML pages. The web browser provides APIs which help in remotely controlling the user interface test web applications.
4. Selenium GRID
- Selenium GRID is a suite that has specialization in running multiple test cases parallelly. These can be different browsers, operating systems, and machines in parallel. It uses the concept of hub-node. This means that only running the test on a single machine but executing it on different nodes. This helps in parallel execution and makes GRID platform-independent. Also, it is not browser-specific and supports all browsers.
- There are two versions of Grid. They are Grid 1 and Grid 2. Hub is the central point where all test cases are to be loaded. There should be only one hub in the grid. There are be any number of nodes in the grid. Also, nodes can be launched on different platforms and browsers.
Conclusion
In the fast-changing world, it is very important that all tasks are being performed quickly. Automation plays an important role in accomplishing this. Selenium is a tool that is open source and provides a quick tool for automating different web applications. Its four components help in the record and play, run multiple test cases and provides facilities of using different browsers and languages for automation. Being open-source, it is free and everyone can download and use it as and when needed.
Recommended Article
This has been a guide to Components of Selenium. Here we discuss the different components of selenium in detail. You can also go through our other suggested articles to learn more –