0
1.3kviews
What is Selenium?
1 Answer
0
11views

Selenium is a free (open source) automated testing suite for web applications across different browsers and platforms. It is quite similar to HP Quick Test Pro (QTP now UFT) only that Selenium focuses on automating web-based applications. Testing done using Selenium tool is usually referred as Selenium Testing.

Selenium is not just a single tool but a suite of software's, each catering to different testing needs of an organization. It has four components.

  • Selenium Integrated Development Environment (IDE)
  • Selenium Remote Control (RC)
  • WebDriver
  • Selenium Grid

Selenium RC (Remote Control)

Before I talk about the details of Selenium RC, I would like to go a step back and talk about the first tool in the Selenium project. Selenium Core was the first tool. But, Selenium Core hit a roadblock in terms of cross-domain testing because of the same origin policy. Same origin policy prohibits JavaScript code from accessing web elements which are hosted on a different domain compared to where the JavaScript was launched.

Selenium IDE (Integrated Development Environment)

In 2006, Shinya Kastani from Japan had donated his Selenium IDE prototype to Apache’s Selenium project. It was a Firefox plugin for faster creation of test cases. IDE implemented a record and playback model wherein, test cases are created by recording the interactions which the user had with the web browser. These tests can then be played back any number of times.

The advantage with Selenium IDE is that, tests recorded via the plugin can be exported in different programming languages like: Java, Ruby, Python etc. Check out the below screenshot of Firefox’s IDE plugin.

But the associated shortcomings of IDE are:

  • Plug-in only available for Mozilla Firefox; not for other browsers
  • It is not possible to test dynamic web applications; only simple tests can be recorded
  • Test cases cannot be scripted using programming logic
  • Does not support Data Driven testing

Selenium Grid

Selenium Grid was developed by Patrick Lightbody and initially called HostedQA (initially a part of Selenium v1) and it was used in combination with RC to run tests on remote machines. In fact, with Grid, multiple test scripts can be executed at the same time on multiple machines.

Parallel execution is achieved with the help of Hub-Node architecture. One machine will assume the role of Hub and the others will be the Nodes. Hub controls the test scripts running on various browsers inside various operating systems. Test scripts being executed on different Nodes can be written in different programming languages.

Grid is still in use and works with both WebDriver and RC. However, maintaining a grid with all required browsers and operating systems is a challenge. For this, 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. It has more than 2000 browser environments over which you can run your tests and truly automate cross-browser testing.

Selenium WebDriver

Selenium WebDriver was the first cross platform testing framework that could control the browser from OS level. In contrast to IDE, Selenium WebDriver provides a programming interface to create and execute test cases. Test cases are written such that, web elements on web pages are identified and then actions are performed on those elements.

WebDriver is an upgrade to RC because it is much faster. It is faster because it makes direct calls to the browser. RC on the other hand needs an RC server to interact with the web browser. Each browser has its own driver on which the application runs. The different WebDrivers are:

  • Firefox Driver (Gecko Driver)
  • Chrome Driver
  • Internet Explorer Driver
  • Opera Driver
  • Safari Driver and
  • HTM Unit Driver

Benefits Of Selenium WebDriver

  • Support for 7 programming languages: JAVA, C#, PHP, Ruby, Perl, Python and .Net.
  • Supports testing on various browsers like: Firefox, Chrome, IE, Safari
  • Tests can be performed on different operating systems like: Windows, Mac, Linux, Android, iOS
  • Overcomes limitations of Selenium v1 like file upload, download, pop-ups & dialogs barrier

Short-comings Of Selenium WebDriver

  • Detailed test reports cannot be generated
  • Testing images is not possible
Please log in to add an answer.