Different Components Of Selenium

Selenium is one of the most popular tools used for automating web applications.

Selenium is an open source tool, which is used for the execution of  test scripts or test cases on the web application.

Selenium is an open source tool, which supports various programming languages such as Java, C#, PHP, JavaScript, Ruby, Python etc.

Selenium  is language independent, which means Selenium was developed using Java , and which can be used with either C# , Java , Php , Javascript etc.

Selenium can be executed on various operating systems like Windows, Linux, MacOS etc.
 
As Selenium is language independent, it  is also  platform independent. The code or framework developed using C#/Java can be executed in different platforms/operating systems like Windows OS , Mac OS , Linux etc.

Selenium is a library or API which consists of classes, methods, interfaces, etc., which can be used and  integrated  with various programming languages mentioned above.

Selenium is written, using one of the most famous programming languages; i.e. Java, and it's  cross-platform.

Selenium supports various programming languages and various platforms. For these reasons, most of the top companies prefer Selenium rather than using Quick Test Professional (QTP) and CodedUI, which are both licensed versions.
 
Selenium supports various browsers such as Google Chrome, Edge Browser (Windows 10), Firefox Browser, Internet Explorer, Safari etc.

Each browser has its own driver,  for executing the test scripts on their browsers, such as, for executing the Selenium Scripts on Chrome we have Chromedrivers, for executing the Selenium Scripts on IE we have Internet Explorer drivers, for executing the Selenium Scripts on Safari we have Safari drivers, for executing Selenium Scripts on Opera, we have Opera drivers.
 
Internet Explorer(IE) driver and GoogleChrome driver support both 32bit and 64 bit versions, which we can download and use based on our system requirements.

Selenium webdriver and Selenium grid are the most commonly used tools in the IT industry for the development of testing products.

In Selenium, earlier versions like Selenium 1.0 and Selenium 2.0, we aren't required to set up Firefox drivers for executing the scripts on the Firefox Browser. By default Selenium has support for Firefox.

In Selenium 3.0, all the vendors like Google, Apple, Microsoft, Firefox have their own drivers to work with Selenium. 
 
Selenium was developed as an internal project to test internal applications at ThoughtWorks, which was developed in client side technology like JavaScript by Jason Huggins. It is also called Selenium Core /Selenium IDE.

Jason Huggins tested various internal applications and gave demos to different colleagues. Additionally, they were excited about the success of the first version.

Later, Paul Hammant joined his team and developed the other version of Selenium; i.e., (Selenium RC) then this tool became open-source to work with the different Browsers and different platforms.

Simon Stewart at ThoughtWorks developed an Automation tool for the browser known as Webdriver and later they merged these Selenium RC with Webdriver called Selenium Webdriver(Selenium 2.0).

Philippe Hanrigou at ThoughtWorks developed Selenium Grid in the year of 2008. Selenium Grid is used for configuring single hub and multiple nodes.

The current hub is capable of running multiple test cases on client machine as well as remote machines, which reduces the time as well as resource.

Finally, Selenium 3.0 was developed in this year with the new features. It is a combination of Selenium 2.0 +  Selenium 1.0, which means it supports Selenium 2.0 features but it doesn’t have support for Selenium 1.0; i.e., Selenium Core.

Please refer to my article, http://www.c-sharpcorner.com/article/introduction-to-selenium-3-0/, to know more about Selenium 3.0.

When Selenium was in development, one of the most popular testing tools was called QTP (Quick Test Professional) which was developed by "Mercury Interactive" before it was acquired  by HP.  QTP was Selenium's competitor, they have named their product based on the element selenium. As we know the chemical element term Selenium (Se) is capable of poisioning/detoxifying Mercury. so the term or the product was named Selenium.

This was a brief introduction about Selenium, let us look into various components of Selenium.

Refer to this link to learn more about Selenium,
  • https://drjockers.com/how-selenium-helps-to-detoxify-mercury/ to know how selenium element detoxifies Mercury.
  • https://www.guru99.com/introduction-to-selenium.html
  • https://www.it.iitb.ac.in/frg/wiki/images/d/d0/Sukhdeo_week_03_report_03.pdf to learn more about selenium.
Different Components Of Selenium
 
Selenium IDE
 
 
 
Selenium IDE is also known as Integrated Development Environment which is a GUI based application.
  • It supports Edit , Record and debugging feature also called  Record/Replay (or) Record/Playback.
  • It is a Firefox Add on/Extension , which works only in fthe Firefox browser.
Selenium IDE supports its own scripting language called Selenese , which doesn't require any programming language or complex commands to execute test cases. I works with the older version ofthe Ffirefox browser. We can navigate to  Firefox Add on / Firefox Extensions in the Firefox browser and search for Selenium IDE and install it.
  • It is based on javascript and it's very easy to use.
  • It doesn't have any kind of API's or Library to work with , because it doesn't need any programming language.
In Selenium IDE the execution of test cases is very slow, and the report generation step for the test cases is not good as compared with other components which will be discussed below.
  • It doesn't support execution of test cases in parallel or remote execution.
  • The Selenium IDE has Command and target textboxes, command is used for actions like click; type on a particular control and target for specifying the control properties.
The export is used to export the Selenese scripting to either C# , Java , php etc.
  • It doesn't support mobile based testing like iPhone/Android testing etc.
As it doesn't support any programming languages, we can't apply any logic or conditions to the test cases. Refer  tothis link for the installation process:
  • http://www.seleniumhq.org/projects/ide/
  • http://toolsqa.com/selenium-ide-tutorial/
  • http://www.softwaretestinghelp.com/selenium-ide-download-and-installation-selenium-tutorial-2/
From the above explanation , the drawbacks of Selenium IDE are,
  • The test cases can be executed in only in the Firefox bowser.
  • The execution of test cases is very slow and the report generation step is not good as compared with other components.
  • It doesn't support parallel/remote execution of test cases.
  • It doesn't support logical/conditional statements because it is easy to use without any programming languages.
  • It doesn't support any complex scenarios/complex test scripts/test cases.
  • To overcome the above problem we have another component of Selenium, and that is Selenium RC. 
Selenium RC

Selenium RC is also known as Selenium Remote Control.
  • It is the starting version of Selenium.
  • It doesn't have any GUI interface, rather it contains libraries or API's which consist of various Classes , Methods , Interfaces which are used with various programming languages like C# , Java , PHP , Perl etc.
  • It is based on object oriented programming principles.
  • It supports various programming languages like C# , Java , php etc
As selenium RC was developed using Java, it is recomended to use with Java, as it supports language independence so we can integrate Selenium RC with other languages like C# as well.
 
Unlike Selenium IDE , the execution of test cases can be executed only in the Firefox browser. Selenium RC is the advanced version of Selenium IDE , which allows you to execute the test cases or test scripts in various browsers like Chrome, Firefox , IE , Safari , opera etc.
Selenium RC supports language independence which means we can integrate Selenium RC with either of the above mentioned languages like C# , Java , php etc. It also supports platform independence which means the scripts/code written using C#/Java can be executed in various platforms like Windows OS , Mac OS , Linus etc.
  • It is also based on Javascript . It doesn't have Record/Playback feature.
  • It doesn't support mobile testing like iPhone/Android.
  • It is based on client/server architecture which means whenever we want to execute the test cases / test scripts we need to start the server manually to execute the test cases. 
  • It supports parallel execution of test cases as well as remote execution with the help of Selenium grid.
Whenever we want to execute the test cases , the selenium server acts as a mediator/server which should be started manually.
  • It supports execution with  Asynschronus Javascript and XML (AJAX) based applications as well.
Whenever we develop the framework using the above mentioned programming languages, this code is sent to Selenium Server wich acts as a mediator /server which in turn converts the code to javascript and sends it to the browser. As the browser understands Javascript the browser executes the given test cases and returns the result back to the server or Selenium server and this server returns the result to the client.

The drawback of the above selenium RC is,

Whenever we want to execute the test cases we need to start the server or Selenium server manually. The code doesn't interact directly with the browser rather the mediator is required. It doesn't support mobile based application testing.

To overcome the above problem we have Another version of selenium, that is Selenium Webdriver. 
 
Selenium Webdriver

To overcome the above problem with Selenium RC, webdriver was developed. Webdriver is a combination of selenium RC+webdriver to form Selenium webdriver.

Selenium webdriver doesn't require starting the server/Selenium server to execute the test cases.
  • It supports various programming languages like C# , Java, php, Perl, Python etc
  • It supports various platforms to execute the test cases like windows OS , Mac OS , Linux etc.
  • It supports parallel execution as well as remote execution.
Unlike Selenium RC which requires Selenium Server as a mediator to start for the execution of test cases, Selenium webdriver doesn't need to start the server, which interacts directly with the web browser to execute the test cases.

It's a library or API which consists of various Methods/classes/Interfaces to use with various programming languages like C#, Java, Python etc.

Each browser has its own drivers like, 
  • To execute a test case in Chrome we have Chromedriver
  • To execute a test case in Firefox we have Geckodriver
  • To execute a test case in Safari we have Safaridriver
  • To execute a test case in Internet Explorer we have IEdriver
  • To execute a test case in Opera we have Operadriver
It also supports execution of test cases with the ajax based application. The above drivers can be downloaded from http://www.seleniumhq.org/download/

Selenium webdriver supports execution with mobile based testing like Selendroid or appium etc.
 
Selenium Grid

It is a tool which is used for the execution of parallel as well as remote execution by using Selenium RC or Selenium Webdriver.

For execution of test cases in remote machines which are connected in LAN networks we need to configure hub and node. Hub acts as a mediator or like a server and multiple nodes are configured to a hub.

If we want to execute the test cases, say 6 different test cases with 3 different nodes connected to a hub, then the hub's responsibility is to distribute the six different test cases among 3 different nodes which are connected to hub.

If Chrome, Firefox, and Opera are connected to a hub then two cases will be executed in Chrome, two in Firefox, and two in Opera.
With the help of parallel as well as remote execution the test cases will be executed in various machines which are connected in LAN network which saves lot of time or human resources.
 
Thanks and I hope this article helps you.  Please provide me with feedback for my article.


Similar Articles