Free Selenium Tutorial

Introduction to Selenium

In the chapter 1 of Selenium Tutorial for beginners, we will provide an introduction to Selenium and its components. Selenium is the most popular platform for the automation of testing in the IT industry today.

Techcanvass has created a complete set of Tutorials on Selenium and Java. The link to access the tutorials is provided below.

Introduction to Selenium

Selenium is one of the most popular and powerful automation testing platforms. Selenium is not a tool but a suite of components, which are developed by open source community. The current version of Selenium suite, as of 2017, is 3.0.

In addition to Selenium 3.0, there are several automation testing tools available in the market e.g. HP UFT (Unified Functional Testing tool), TestComplete etc.

However, before we proceed further, let’s look at some of the key aspects of Selenium 3.0 suite:

  • It’s open source meaning that it’s completely free
  • It supports multiple languages for writing automation scripts like Java, Python, C# etc
  • It also supports multiple browsers
  • The open source community is wide spread and keeps on adding new components and upgrading the existing versions.

Selenium 3.0 Suite

Selenium 3.0 suite comprises of multiple components. The latest version of selenium is 3.0, which was released in 2017. Let’s have a brief look at the evolution of Selenium from the early days to the latest version 3.0.

Selenium 1.0

Selenium can be traced back to Thoughtworks’ Jason Higgins. However, several teams/individuals worked to develop various components independently. Selenium IDE was developed by Shinya Kasatani, while Selenium RC Server (Remote Control Server) was developed by Dan Fabulich and Nelson Sproul (of erstwhile BEA systems, acquired by Oracle). Jason, with support of seniors and colleagues, develop Selenium web driver and released it as Open source.

Selenium 2.0

Selenium 2.0 maintained two core components – Selenium Core and Web driver APIs working together. But it got rid of Selenium RC server and injecting code into your pages to automate testing. Web Driver APIs made it simpler to write automation scripts for any browser by simply using the appropriate driver for any browser.

Selenium 2.0 architecture was as shown below:

Selenium 2.0 Architecture

A web driver is developed for each browser and replaces the JavaScript that was embedded on web applications being tested in the earlier version. This tighter integration with the browser allows for the creation of more advanced tests, and removes the restrictions placed by the JavaScript security model. It also works on Android (AndroidDriver) and iPhone (IPhoneDriver) for mobile web application testing. The WebDriver APIs can be accessed from Python, Ruby, Java and C#, allowing developers to create tests using their preferred programming language.

Another component of Selenium suite is Selenium Grid. It’s used to run Tests on different machines at the same time. It is also used to run tests on different browsers, OS platforms. Please note that Selenium GRID is no longer an independent component but part of selenium server since the release of Selenium 2.0.

Selenium 3.0

 Selenium 3.0 was officially released on Oct 13, 2016. What are the changes from 2.0? In this section, we are going to have a look at these changes:

Gecko Driver

 Though completely independent of Selenium 3.0 release, Mozilla has made structural changes to the its Firefox driver. Firefox versions prior to version 48, had web driver integrated and you didn’t need to provide the path of the webdriver executable.

However with Firefox 48 and beyond, this has changed. Just like Internet Explorer / Edge or Chrome browser, you need to now provide the path of Firefox gecko driver executable.

This is nothing to do with selenium 3 but with Mozilla. So even if you are using Selenium 2.0, you will need to invoke gecko driver with Firefox 48 and above.

 No Selenium Core

With the release of Selenium 3.0, there is no selenium core. Selenium 2 supported selenium core for backward compatibility. There is no selenium core in version 3.0.

Selenium official bog states that

“Over time, the needs of modern web testing have grown ever more complicated and sophisticated, and Selenium Core is now less capable of meeting these needs than it was before.”

This means that if you or your company is using Selenium core, you need to migrate your code.

Selenium IDE exported script

If you use selenium IDE to write code and export it in table format for execution purposes, you need to use a new test runner. Selenium Html Runner can be used for this purpose and is available in the download section of Selenium official website.

Selenium 4.0

Selenium 4.0 is also making its way. You can learn about what’s new in Selenium 4.0

What’s Next?

In this tutorial, we have provided an introduction to Selenium. Next, You can go and read All the Selenium tutorials.

Become a Selenium Automation Testing professional

Techcanvass offers Automation Testing and Business Analysis certification courses. We are an IIBA endorsed education provider (EEP), iSQI Germany Authorized Training as well as Agile Testing alliance partner for CP-SAT certification training in Selenium.

We offer Selenium Classroom training in MumbaiSelenium Training with PythonCP-SAT certification Training and many short courses on Automation – BDD Automation testing with CucumberContinuous Integration Training with JenkinsAutomation testing Frameworks Training and Continuous Integration with Jenkins, Maven and GitHub.

One of the key features of our courses is the Job readiness package, as shown below: