What is Selenium

Photo of author

By Vijay Singh Khatri

If you want to get a certification in Selenium to get a job in the field, then you will have to start with “what is Selenium?”. Developers spend hours after hours testing a web application to ensure that it is working fine inside as well as outside of the environment where the app was developed. When Selenium was not in the picture, people used to test the applications manually to find out what was wrong with them and how to solve the issue.

Since people were testing the applications, depending on the size of the team, the testing method could go on for anywhere from a few days to several weeks. But these days, the development of web applications can be wrapped up in 2–4 weeks. If you integrate Selenium into the app development process, you can get almost instant feedback on the app testing. That’s why selenium is such a hot topic these days, but to learn more about it, you will have to check out this post thoroughly.

What is Selenium?

Selenium refers to an open-sourced tool that developers use for automatic web application testing to check if the app is working in the browser. This tool is free, but it only allows us to test web apps, not desktop or mobile applications. Except if you are searching for a mobile or desktop app tester, then go with IBM, Appium, etc. But in this post, we are only going to talk about testing web apps using Selenium and why developers prefer this tool over anything else.

To generate Selenium test scripts, you can apply programming languages such as Python, Java, etc. And when you test an application using Selenium, the process is known as “Selenium Testing.” Selenium testing comes with several in-built tools such as Selenium Grid, WebDriver, Selenium Integrated Development Environment (IDE), and Selenium Remote Control (RC). Selenium WebDriver and Selenium RC are combined into a singular framework that creates Selenium 2. And Selenium 1 is Selenium RC itself. Before we get into the features of Selenium, it’s important to note its advantages.

What are the Advantages of Selenium?

Due to its open-sourced nature, there is no licencing cost included in Selenium, and that is the most important advantage of Selenium over other similar tools. Other reasons why developers prefer it are as discussed below.

  • You can write Selenium test scripts using any programming language, such as Python, Java, PHP, C#, etc.
  • Tests can be done on any platform, including Windows, Linux, or Mac.
  • Tests can be done on any browser, including Internet Explorer, Safari, Google Chrome, Firefox, etc.
  • To manage test cases and create reports, developers can integrate the tool with TestNG and JUnit.
  • To achieve continuous testing, developers can integrate it with Docker, Maven, etc.

But advantages are not the only things you need to be aware of.

What are the Disadvantages of Selenium?

Below listed are some of the shortcomings of this web-application testing tool:

  • You can only test web apps using Selenium and not mobile or desktop applications
  • There is no round-the-clock technical support available for Selenium users, but you can find support from Selenium communities where other users share their thoughts
  • You cannot test images using Selenium but if you want to test images, then integrate Selenium with Sikuli
  • There is no native feature available for creating reports, but if you integrate Sel with TestNG or JUnit frameworks, then reporting creation will be available.

We will go further to explain about Selenium, the web app testing tool but before that, let’s find out a little bit about its history.

What is the History of Selenium?

Selenium is actually a group of different tools that help developers with the testing process. In 2004, Jason Huggins created Selenium because he was having issues with frequent testing of applications. He realised that performing manual testing on apps repeatedly was not enough, and for that, he also created a Javascript application that would monitor the browser’s activities. We call that app JavaScriptTestRunner, and later, he made the tool open-sourced for other users to benefit from it. Selenium Core, named lately after the release, is a JavaScriptTestRunner. But Selenium Core wasn’t enough.

The History of Selenium Remote Control (Selenium RC)

But when people were using Selenium Core, they had to install the entire app under test and the webserver on their personal system. That’s why Paul Hammant, a colleague of Jason’s, created a server that would act as a proxy to make the browser believe that the Selenium Core and the web app belong to the singular domain. This facility then became Selenium RC, or Selenium 1.

The History of Selenium Grid

Selenium Grid was designed to minimize the execution time of app testing. It was founded by Patrick Lightbody, but it was known as Hosted QA at the beginning of the release of Grid. The grid can capture the screenshots from the browser during different stages of the app testing and sends out commands to different servers at the same time.

The History of Selenium IDE

The IDE was created by a Japanese engineer named Shinya Kasatani. Selenium IDE is a Firefox extension that comes with a record-and-playback feature for automating the browser. This tool increases the speed of the test.

The History of WebDriver

Webdriver was created by Simon Stewart in 2006 during the time when browsers and web apps were facing restrictions from Selenium Core. But this testing framework is capable of monitoring the browser from the operating system so that the web app can trick the browser into believing that the two of them belong to the same domain.

The History of Selenium 2

In 2008, the developers of Selenium decided to combine WebDriver and RC into the same tool and named it Selenium 2. Here, WebDriver was the core, and RC is in maintenance mode while still improving itself. Developers are, however, focusing mainly on the development of Selenium 2 at the moment.

What is the Same Origin Policy?

The Same Origin Policy does not allow Javascript codes to access elements from a domain that is not related to Javascript. That’s why when Selenium RC wasn’t in the picture, developers needed to install local copies of Core and the web server that tested web applications to make them combine into a single domain.

Now that we know why Selenium was created, we should also talk about the main components of Selenium and how it benefits the users.

What is Selenium IDE?

Selenium Core, Selenium Integrated Development Environment (IDE), is a framework that you can learn easily because it is simple to execute. The IDE is a Firefox plugin that is straightforward to install, but this plugin is a prototyping tool, and it is not suitable for advanced testing. For advanced testing, use RC or Webdriver.

Pros

  • Easy to install
  • Easy to use
  • Does not require any programming knowledge other than HTML and DOM
  • Has in-built help and report generation modules

Cons

  • Only available in Firefox
  • Only creates prototypes of tests

What is Selenium RC?

Remote Control, or RC, was initially known as the flagship testing framework and it was the first automatic tool that let developers use the programming language of their choice. Currently, Selenium Remote Control supports Java, C #, Python, Ruby, PHP, and Perl programming languages.

Pros

  • Cross-platforms and cross-platform support
  • Support data-driven testings
  • Executes faster than IDE
  • Complete API

Cons

  • Complicated installation
  • Requires programming knowledge

What is WebDriver?

WebDriver claims to be superior to RC and IDE in a variety of ways.WebDrivers provide a modern and secure approach when it comes to automating the browser’s performance. But it does not depend on Javascript or automatic testing and monitors the browser by directly interacting with it. Like RC, WebDriver supports Java, Python, Ruby, PHP, C #, and Perl.

Pros

  • The installation process of WebDriver is simpler than RC
  • Interacts with the browser directly
  • Realistic browser interaction
  • Executes faster than IDE and RC

Cons

  • Not for beginner developers
  • Does not support new browsers

What is a Selenium Grid?

Selenium Core Grid is another tool in Selenium Core that runs with RC simultaneously to perform parallel tests across various systems and machines at once. Parallel tests must be taking different tests at the same time. Here are its best features in a nutshell:

  • Allows simultaneous tests on different instances and browsers
  • Saves time
  • Applies hub-and-nodes that refer to a central source (hub) that works as commands on every node connected to the hub.

Conclusion

Now you know everything about Selenium, it is important to find what you are looking for in this testing kit. For example, when you are choosing Selenium, you might want the IDE to execute Javascript codes using transcript and also simplicity so that you can generate tests without any prior knowledge of Javascript or programming. And since we have mentioned the benefits and drawbacks of every tool in Selenium, you will understand why developers use it. To learn about Selenium’s competitors like QTP, do follow our other articles.

Leave a Comment