• Selenium Video Tutorials

Selenium - Automation Testing



Selenium is used primarily to automate tests on web applications. It is free, does not require any licensing cost. Automation testing with Selenium is much more preferred than manual testing since the automation testing with Selenium has a better return on investment than manual effort.

Different Types of Selenium Tests

Selenium can be used to create different types of tests as listed below −

  • Functional Tests − These tests help to check various new functionalities and features of the application or the product under test.
  • Regression Tests − These tests help to check if code changes have broken an existing functionality of the application.
  • Smoke Tests − These tests help to verify if a new build is stable enough to carry out testing activities on it.
  • Integration Tests − These tests help to validate if the integration of all the modules are working together as a unit.
  • Unit Tests − These tests are created by the developers to test their code.

Selenium Automation Testing Tools

Selenium comprises a group of tools often called the Selenium components. These tools are listed below −

  • Selenium IDE − It is available as an addon for Chrome and Firefox browsers.
  • Selenium Remote Control − It is server developed in Java and allows writing automation tests in multiple languages like Java, Perl, Python, and so on.
  • Selenium Webdriver − It is a tool that can be integrated with other frameworks like TestNG, JUnit, and so on and can be used with multiple programming languages.
  • Selenium Grid − It is a tool that helps to achieve parallel execution across various platforms and browsers.

Differences Between Selenium Version 3.x and 4.x

The latest version of Selenium is on version 4. From the Selenium 4 version, the entire architecture is fully compatible with W3C - World Wide Consortium meaning Selenium 4 follows all the standards and guidelines given by W3C.

The basic difference between Selenium 3.x and Selenium 4.x is that, in Selenium 3 the communication between client and server is done by JSON Wire protocol, however, from Selenium 4, there is direct communication between the server and client, following the W3C guidelines.

Before Selenium 4, the communication between the client and server was carried on using the JSON Wire protocol over HTTP. However, there is no existence of JSON Wire protocol from Selenium 4, and there is direct communication between the client and server using the W3C protocols.

Also, Selenium 4 gives some additional locators(apart from the regular locators like id, class, xpath, and so on) called the Relative locators with the help of the methods - above, below, near, toRightOf, toLeftOf, and chaining of multiple Relative locators. Selenium 4 also gives access to the ChromeDevTools which help for debugging, network traffic analysis, and other features that help in automation.

Selenium Web Driver architecture as per version 4.0 in a simplified diagram is described below −

Selenium Automation Testing

Why Selenium is Used for Automating Testing?

  • Automation tests using Selenium can be written in multiple programming languages like the Java, C#, Python, JavaScript, and so on.
  • Selenium webdriver supports browsers like Chrome, Firefox, Safari, IE, and so on.
  • Selenium webdriver works on more than one platforms like Windows, Mac, Linux, Android, and so on.
  • Headless execution can be achieved with the help of the HTMLUnit Driver.
  • Selenium webdriver does not require a server to initiate test execution and it communicates directly with the browser.
  • Selenium is open-source and comes without any licensing cost.
  • Selenium can be extended for various technologies that expose DOM.
  • Selenium has a big community support to resolve issues.

Disadvantages of Using Selenium

  • Selenium supports only web based applications.
  • Selenium should not be used to automate tests on QR, captcha and barcode scenarios.
  • Selenium does not have an in-built object repository or recovery scenario.
  • Selenium has no default test report generation.
  • Selenium Webdriver requires programming and technical knowledge to develop automated tests.
  • Selenium Webdriver requires time to be more compatible and stable with new browsers.
  • Selenium Webdriver is difficult to set up since no vendor support is available.

Run Selenium Automation Testing in Different Languages

Selenium can be used to test web applications using multiple browsers, platforms, and devices using different programming languages like Java, Python, Ruby, JavaScript, and so on. Based on the language we are using, the preconditions required to configure the Selenium tests also change. The below links will help to set up and run automation testing in Selenium in different languages −

This concludes our comprehensive take on the tutorial on Selenium - Automation. We’ve started with describing what Selenium is, different types of Selenium Tests, Selenium automation testing tools, differences between Selenium 3.x and Selenium 4.x, why Selenium is used for automating testing, disadvantages of Selenium, and how to run automation testing in Selenium in different languages.

This equips you with in-depth knowledge of the Selenium - Automation Testing. It is wise to keep practicing what you’ve learned and exploring others relevant to Selenium to deepen your understanding and expand your horizons.

Advertisements