What is Selenium

What is Selenium?

Last updated on 19th Sep 2020, Artciles, Blog

About author

Ramkumar (Sr Testing Manager )

He is a TOP-Rated Domain Expert with 6+ Years Of Experience, Also He is a Respective Technical Recruiter for Past 3 Years & Share's this Informative Articles For Freshers

(5.0) | 15537 Ratings 620

Selenium is a free and open-source test automation suite used for automating web-based applications. It supports automation across different browsers, platforms, and programming languages

Using Selenium, we can automate the functional tests and easily integrate them with Maven, Jenkins, and other build automation and continuous integration tools.

Selenium Suite of tools

It has 4 major components with a different approach for automation testing which is popular as the Selenium suite of tools. Every software tester or developer chooses tools out of it depending upon the testing requirement for the organization.

selenium-tools
Subscribe For Free Demo

Error: Contact form not found.

Selenium RC (Remote Control)

Selenium Core was the first tool in the Suite of tools. However, it was deprecated as it had some issues related to cross-domain testing because of the same-origin policy. So, to overcome that Selenium Remote Control (Selenium RC) was introduced after Selenium core. RC turned out as an aid to the cross-domain issue. RC has an HTTP proxy server which helps in befooling the browser into believing that both the Selenium core and Web app which is being tested are from the same domain hence removing the cross-domain issue.

Selenium RC is divided into two parts which help in overcoming the cross-domain issue:

  • Selenium Remote Server
  • Selenium Remote Client

But the major issue with RC was the time taken to execute a test. As the Selenium server communicates using HTTP requests, it was more time-consuming. Because of this limitation, RC also is now not much in use.

Selenium IDE

Selenium IDE, earlier known as Selenium recorder, is a tool used to record, edit, debug and replay functional tests. Selenium IDE is implemented as an extension to the Chrome browser and add-on in Firefox browser. With the Selenium IDE plugin, you can record and export tests in any of the supported programming languages like Ruby, Java, PHP, Javascript, etc.

Selenium Grid

Selenium Grid is based on Hub-node architecture. With Selenium Grid, you can run parallel test sessions across different browsers. Hub controls Selenium scripts running on different nodes(specific browser inside an OS) and test scripts running on different nodes can be written in any programming language.

Selenium Grid was used with RC to test multiple tests on remote machines. Nowadays, as people find Webdriver better than RC, hence Grid works with both Webdriver and RC.

Selenium Webdriver

Selenium Webdriver is an enhanced version of Selenium RC and the most used tool. It accepts commands via client API and sends them to browsers. Simply put, Selenium Webdriver is a browser-specific driver that helps in accessing and launching the different browsers. It provides an interface to write and run automation scripts. Every browser has different drivers to run tests.

  • Mozilla Firefox uses Firefox Driver (Gecko Driver)
  • Google Chrome uses Chrome Driver
  • Internet Explorer uses Internet Explorer Driver
  • Opera uses Opera Driver
  • Safari uses Safari Driver and
  • HTM Unit Driver used to simulate browsers using headless browser HtmlUnit

Selenium Client API

It is the latest tool in the Suite of tools. With Selenium Client API you can write test scripts in various programming languages instead of writing test scripts in Selenese. Selenium client API is available for Java, JavaScript, C#, Ruby, and Python. These scripts can communicate with Selenium with predefined commands and functions of Client API.

Why Selenium for Automation Testing?

Since we are now familiar with Selenium and its suite of tools, let’s find out the various benefits of Selenium which make it stand from the crowd as a tool for automation testing:

  • Open Source Tool: Since it is an open-source tool, it doesn’t require any licensing costs which give it an upper hand over other automation testing tools.
  • Tool for Every need: As mentioned earlier, Selenium has a suite of tools, so it suits every need of the users. You can use various tools like WebDriver, Grid, IDE for fulfilling your different needs.
  • Supports all major languages: The major challenge that a tester or developer faces with an automation testing tool is the support for languages. Since selenium supports all major languages like Java, JavaScript, Python, Ruby, C sharp, Perl, .Net and PHP, it is easier for testers to use.
  • The browser and Operating System support: Selenium supports different browsers like Chrome, Firefox, Opera, Internet Explorer, Edge, and Safari and different operating systems like Windows, Linux, Mac. This makes it flexible to use.
  • Community Support: Selenium has an active open community that helps you solve your issues and queries related to it. This makes it the best choice as your automation testing tool.

Here’s a quick comparison table of Selenium with other available tools:

FeaturesSeleniumQTPRFT
Open SourceYesNoNo
SupportOpen Source CommunityDedicated SupportDedicated Support
Coding Skills RequiredYesNoNo
OS SupportWindows, Linux, MacWindowsWindows
Languages SupportedJava, JavaScript, Python, Ruby, Perl, .Net, C sharpVB ScriptJava and C sharp

Selenium Webdriver and its architecture

Since Selenium WebDriver is the most used tool, so we’ll be using the same to execute Selenium test cases. To understand the complete process on a very simple level, Selenium WebDriver Architecture consists of:

architecture-of-webdriver

Basically, the Selenium web driver works in three layers: Browser Driver, Remote Driver, and Language Bindings.

Core components of WebDriver Architecture:-

  • Selenium Client Library / Language Bindings

Selenium bindings / Client libraries are created by developers to support multiple programming languages. For instance, if you want to use the browser driver in Python, use the Python bindings. You can download all the bindings on the official Website.

  • JSON Protocol over HTTP

JavaScript Object Notation is used as a data transfer protocol to send data from a server to a client on the web. With JSON, it is very easy to write and read data with data structures like Array and Object support. This wire protocol provides a transport mechanism and defines a RESTful web service using JSON over HTTP.

  • Browser Specific Driver

Each web browser has a specific browser driver for Selenium bindings. The browser driver accepts commands from the server and sends it to the browser without the loss of any internal logic of browser functionalities. Browser drivers are also specific to programming languages like Ruby, C#, Java, etc for web automation.

Following are the steps when we run any test script using Webdriver:

  • HTTP request gets generated for every Selenium command and sent to browser driver.
  • A specific browser driver receives the HTTP request through the HTTP server.
  • HTTP Server sends all the steps to perform a function which are executed on the browser.
  • The test execution report is sent back to the server and the HTTP server sends it to the Automation script.
  • Browsers

Selenium Webdriver supports all the major browsers like Google Chrome, Mozilla Firefox, Internet Explorer and Safari browsers.

Setting up Selenium on your Local Machine

Let’s understand the steps of how we can configure Selenium in your local machine and running a test in your local browser.

  1. Install Code editor or IDE (like Eclipse or IntelliJ)

Note: We’ll be using the IntelliJ code editor for writing Automation script.

  • Download and install Java Runtime environment in your local system.
  • Download Java Development Kit
  • Download and install all Java Selenium Files (Selenium Server Standalone)
  • Install Browser Specific Drivers ( In this blog, we’ll perform Automation on Chrome, so Chrome Driver for this case)

Benefits of Selenium WebDriver

  • Selenium WebDriver supports seven programming languages: Java, C#, PHP, Ruby, Perl, Python, and .Net.
  • It supports cross-browser interoperability that helps you perform testing on various browsers like Firefox, Chrome, IE, Safari, etc.
  • Tests can be performed on different operating systems: Windows, Mac, Linux, Android, and iOS.
  • Selenium WebDriver overcomes limitations of Selenium v1 like file upload, download, pop-ups, and dialog barrier

     

          Cons of Selenium WebDriver

  • Detailed test reports cannot be generated.
  • Testing images is not possible.

No matter what, these shortcomings can be overcome by integrations with other frameworks. That is, for testing images Sikuli can be used, and for generating detailed test reports, TestNG can be used.

Selenium Grid – Selenium Grid is a testing tool that lets you run your tests on various machines against different browsers. It is part of the Selenium suite that specializes in running multiple tests across different browsers, operating systems, and machines. You can connect to it with Selenium Remote Control by stating the browser version, browser, and operating system as per your choice. You will be able to specify these values through Selenium Remote Control capabilities. With Selenium Grid, one server makes a move as a hub. Tests communicate to the hub to get access to browser instances. The hub has a list of servers that provide access to browser instances (WebDriver nodes) and lets tests use these instances.Selenium Grid allows parallel testing and also allows managing different browser versions and browser configurations centrally (instead of in each individual test).There are multiple online platforms that provide an online Selenium Grid that you can access to run your Selenium automation scripts. For example, you can use LambdaTest. Selenium Grid has more than 2,000 browser environments over which you can run your tests and truly automate cross-browser testing.

selenium Sample Resumes! Download & Edit, Get Noticed by Top Employers! Download

Advantages of Selenium

              Let’s now see some of the advantages of Selenium-

  • Selenium is open source, there is no licensing cost for its usage.
  • Scripting can be done in most of the widely used programming languages like Java, C#, Ruby, and Python.
  • It supports most of the popular browsers like Chrome, Firefox, Internet Explorer, Opera, and Safari.
  • Selenium IDE component of the Selenium suite provides record and playback features using which non-programmers can also write automation scripts.
  • Selenium Grid helps in parallel and distributed testing.

 Limitations of Selenium

            Some of the limitations of Selenium are-

  • Selenium does not provide desktop application automation support.
  • Web Services – REST or SOAP cannot be automated using Selenium.
  • Selenium WebDriver requires programming language requirements for script creation.
  • For performing common tasks required in automation like logging, reading-writing to external files, we have to rely on external libraries.

Selenium Job Roles!! Upskill Yourself

Selenium job roles vary from company to company, ranging from a mobile development company to a web application development company. Also, our experience in the industry matters when it comes to undertaking a specific Selenium job role.

Some of the popular Selenium job roles that an automation testing company can offer us are:

  • Selenium Automation Engineer
  • Selenium Tester
  • Senior Quality Engineer – Automation
  • Mobile Testing Lead
  • Java Selenium Automation Engineer
  • Selenium Test Analyst
  • Senior QA Automation Engineer
  • Software Development Test Engineer

Conclusion:

Selenium is one of the best automation testing tools which can be used to automate web browser interactions. You can perform automation testing by writing code in any of your preferred language supported by Selenium and can easily run your automation script to automate testing of an application or a process. Its ease of use makes it different from other tools and with the help of an online grid you can even run your tests in parallel across more than one browser. So, what are you waiting for? Write a beautiful automation Script and test your website! If you have any questions, let us know in the comments section below.

Are you looking training with Right Jobs?

Contact Us

Popular Courses