What is Selenium Java Architecture

Selenium architecture

Overview of the selenium architecture

Currently, selenium is one of the most popular automation tools on the market. It's a very powerful tool and it's widely used. One of the reasons for its popularity is that it's free, meaning it's an open source test suite. Its popularity is not just a result of this, but many other reasons. It is a web application automation tool and supports all different browsers like Internet Explorer, Chrome, Safari, Mozilla Firefox, Opera etc. It extends the support to different platforms along with different programming languages ​​like C #, Java, Perl, PHP, Python, Ruby. Selenium is somewhat similar to the UFT tool (HP Quick Test Pro or QTP). The main difference is that selenium is only intended for the automation of web-based applications. If you use selenium for testing it is called a selenium test.

Remember that Selenium is an open source web user interface suite for testing automation. It has a lot of software independently tailored to the needs of an automation tester in an organization. The tool was developed in 2004 by Jason Huggins at thought works as an internal tool. Selenium supports various platforms such as Windows, Linux, Solaris and Macintosh. It also supports OS (Operating System) for mobile applications like Windows Mobile and Android Mobile, iOS. All functional tests can be easily automated and carried out with selenium. In order to achieve continuous testing, it can also be integrated with other test tools for automation such as Maven, Docker, Jenkins, etc. Since selenium is not able to create test reports itself, it should be integrated into tools such as JUnit or TestNG in order to manage test cases and create reports that are meaningful and configurable according to our requirements.

Selenium architecture

The four main architectures of selenium are listed below:

  1. Selenium IDE
  2. Selenium RC
  3. Selenium web driver
  4. Selenium grid

1) Selenium IDE or Integrated Development Environment can be implemented as an extension of Firefox. There is no programming logic required to write test scripts in IDE because you can simply record the events that occur as a result of your interactions with the browser, as well as the capabilities to play, edit, and test the troubleshooting. All of the recording and playback can be performed in an actual environment. The generated scripts can later be edited by hand. It is believed that this is an ideal environment for creating Selenium test scripts, regardless of your preferred testing method. It is true that you do not need any knowledge of programming languages ​​to use Selenium IDE. However, when using Selenese commands like runScript etc. it is helpful to have a basic knowledge of JavaScript using a browser, i.e. Mozilla Firefox.

2) Selenium Remote Control is an automation test tool that allows you to create test scripts for a web application in any programming language with any browser that has JavaScript enabled. Basically, Selenium RC consists of two main components - a server and a client library.

The role of a server is to start and stop the browser, to receive and check HTTP requests that come in between the browser and the application to be tested, to interpret and execute the Selenese commands passed by the test program and as HTTP To act as a proxy. However, the client libraries act as an interface between the Selenium RC server and various programming languages ​​used.

The methodology of the client-server architecture of RC with Selenium RC between the Automation Suite and AUT (Application Under Test) slows down the execution of scripts. This is done by the Selenium Webdriver as it communicates directly with the AUT and uses the natural compatibility of the browser with the automation without the need for a server.

3) Selenium WebDriver is the most popular and important component of selenium. It's one of the most popular automation tools that several automation engineers currently rely on. The tool is an "open source tool", ie it is available free of charge.

WebDriver is an improved version of Selenium RC that, unlike Selenium IDE, extends support for various browsers and platforms. In contrast to the Selenium RC, no Selenium server needs to be started to run test scripts. Selenium Webdriver is basically a web-based test automation tool API that is easy to understand and use. It also supports testing dynamic web pages. Selenium Webdriver helps to create and manage test scripts in a very simple way as it is not linked to a test framework or tool. This facilitates the integration with open source tools like Junit, TestNG etc. according to our knowledge, our requirements and our usage.

4) Selenium Grid is one of the components of the Selenium Suite that supports the execution of multiple test scripts across different browsers or operating systems or computers. After you have specified the operating system of your choice along with the browser and browser version, the Selenium grid can be easily connected to the Selenium remote control. These values ​​can only be specified based on the capabilities of the Selenium remote control being used.

The hub and node are the two main components. To use the Selenium Grid Tool, you first need to create a hub. After a hub has been created, several different nodes can be connected to that hub. The test scripts are executed in the node. However, the function of the hub is to ensure that the test completes correctly with the specifications given in your test, such as the machine, operating system and browser information.

Conclusion

In summary, Selenium is basically a suite of tools, namely IDE, which is a Firefox extension that enables recording and playback functions. The recording / playback function is limited and only available for Firefox. The second tool is the RC with Webdriver (third tool) as an extension, which offers APIs in different languages ​​and browser compatibility. After all, the grid is responsible for enabling the parallel execution of scripts in different browsers and machines.

Recommended articles

This was a guide to the Selenium architecture. Here we discuss the introduction and top 4 architecture of selenium. You can also go through our other item suggestions to learn more -

  1. Career in selenium
  2. Error lifecycle when testing software
  3. How to install selenium
  4. Selenium interview questions