×

Selenium Tutorial

What is Selenium?

Selenium is a functional testing tool and compatible with the non-functional testing tools also. Selenium is free and does not require any licensing. Functional tests script executed by selenium. Selenium is combined with many automation testing tools such as Maven, Jenkins, to achieve continuous testing. Selenium can be connected  with tools like TestNG, & JUnit for managing test cases & generating reports.

Thought Works Company introduced Selenium community in 2004.

Before going further with Selenium Tutorial, let us first understand some of the key concepts associated with Automation testing of an application.

  • Each software development group need to carry out several tests before launching the final product into the market. 
  • Manual Test engineers seek to catch the fault or bugs before the product released in the market, yet delivered software always has defects. And there is a possibility that the final software product is left with a defect or unable to meet the customer requirement, even the manual test engineer do their best.
  • Automation testing is the best way to increase the effectiveness, efficiency, and coverage of Software testing.
  • Automation testing uses particular tools to automate manual design test cases without any human interference. These testing tools can access the test data, controls the execution of tests, and compares the actual result against the expected result. 

 It has both functional and non-functional tests on an application.

Functional Automation Testing

To automate the functional test cases, test engineer use functional automation testing.

e.g.-: Repetitive Regression tests are automated.

Non-functional Automation Testing

To automate the non-functional performance test cases.

 e.g.-: Checking the response time of the application under considerable (say 100 users) load.

What is Selenium?

Automation Testing Process

Automation Testing Process

It is the process of converting any manual test cases into a test script using automation tools, and scripting or programming language is called automation testing process.

  • Generally, we go for automation testing whenever there are multiple releases or multiple regression cycle or repetitive task.
  • The process of testing the application by using some tools is known as automation testing.
  • When the new release (Release #1) starts we don’t go for automation testing process, because there is no concept of regression testing and regression test cases( test cases are new itself)
  • When the new release and some enhancement are going on, we have the manual team as well automation team.
  • The manual teams go through the requirement and also identify the impact area and hands over the regression test suite to the automation team.
  • After handed over the manual team, start working on the new feature and the automation team starts working on the new feature, starts creating the test script and automating the test cases. Means (convert the regression test cases into the test script).
  • Before going to the further process, the automation team starts automating the test cases and analyze the cases which can be automated and which cannot be automated.
  • Based on the review, they start the automation testing process, i.e., convert each regression case into test scripts.
  • During this process, they need regression case because they don’t have product knowledge as well the tool and the application.
  • Once the test script is ready, they start the execution of this script on the new application, but the old feature.
  • Since the script is written for regression feature or the old feature
  • Once the implementation complete, we get different status like pass/fail.
  • If the status failed, that needs to be re-confirmed manually, and if the bugs exist, report to the developer, they will fix.
  • After the bug fixes done, the bug needs to be re-tested along with the impact area by the manual test engineer.
  • And the test script needs to be executed by the automation test engineer.
  • This process goes on until all the new features, and regression features status gets passed.

The advantage of doing regression testing by automation test engineer

  • Time saving: the execution is always faster than the manual.
  • Batch Execution: batch execution is possible using automation testing, i.e., all the written script can execute parallel or simultaneously.
  • Re-used: the script can be reused across multiple releases.
  • Even though the number of regression test cases increases the number of releases, we don’t have to increase the automation resource since some regression case already automated from the previous release.
  • Accuracy always exists because the task is done by tools and tools never get bored or tired.

Features of Selenium

Selenium is just a chemical name which can remove or kill Mercury from the body (Mercury is the vendor of QTP tool).

Some of the essential features of Selenium are as follows:

Features of Selenium

Web-based automation testing:

  • All selenium tools support only web application. The application which is opened by browser or URL is called web application, e.g., - Gmail, Amazon, IRCTC.

Multiple OS

  • Selenium supports multiple operating systems, E.g., Window, Linux, and macOS with Selenium Suite of solutions. For instance, we can create test cases using Windows OS and run it with ease on a Linux based system.

Multiple Browser

  • Selenium supports multiple browsers like- Internet Explorer, Mozilla Firefox, Google Chrome, and Safari. And it becomes highly resourceful while we were executing the tests script and testing it across various browsers simultaneously. E.g., Selenium-IDE can be used with Firefox as a plug-in and Selenium-RC, and Web driver supports different browsers such as Internet Explorer, Chrome browser.

Multiple programming Language

  • Selenium supports multiple programming languages like-C#, Java, Perl, PHP, Python, and Ruby.
  • Selenium can work with various languages, so developers/testers can use any of the above languages in which they feel comfortable.

Multiple Frameworks

Some testing frameworks that can be used for Selenium are as follows:

Languages Available Framework
Java JUnit, TestNG
C# NUnit
JavaScript WebdriverJS, webdriverIO,NemoJSNightwatchJS
PHP Behat+Mink
Python Py.test, robot framework, Unittest, pyunit
Ruby RSpec

Open Source:

  • Selenium tool can be downloaded free because it is an open-source tool and freely available in the market.
  • The most significant advantage of Selenium is that it is a freeware and a portable device.

Some additional features of Selenium are as follows:

  • Selenium Webdriver is more powerful because it supports multiple browsers, multiple operating systems, multiple mobile applications like- iPhone, ANDRIOD.
  • All selenium tools do not support the standalone application, the application which is not opened by browser or URL is called standalone application, e.g. - Notepad, Excel Sheet, Ms-Word, Calculator, Skype
  • All selenium tools will identify the element in GUI based on HTML Source of the component.
  • Selenium has capabilities to support Selenium IDE, Selenium Grid, and Selenium Remote Control (RC).
  • Selenium has a user-friendly interface that helps to create and execute tests efficiently and effectively.

Selenium Index

Selenium IDE Topics

Selenium WebDriver Topics

Interview Questions

  • Selenium Interview Questions

Related Topics

Selenium-IDE Installation in Chrome

Selenium-IDE Installation Since Selenium IDE is designed only for Firefox and Chrome plug-in, we are assuming that you have already installed the Google Chrome browser in your system. However, you can...

1 minute read.

Selenium WebDriver Characteristics

Characteristics of Selenium WebDriver Some of the essential characteristics of Selenium WebDriver are as follows: Multiple Operating System Support Selenium Webdriver supports multiple operating systems like: Desktop OS: Window, Linux, and macOS Mobile OS:...

2 minutes read.

Selenium WebDriver - Browser Controls Commands

Selenium WebDriver - Browser Controls Commands WebDriver includes operations like opening a browser, fetch the title, and closing the browser, etc. Some of the most commonly used Browser controls commands for Selenium WebDriver...

6 minutes read.

Selenium vs QTP

In this section, we are comparing the most frequently used automation tool –Selenium and QTP. Selenium and QTP have relative advantages over each other- FeaturesSeleniumHP QTPLicensingSelenium is an open-source testing tool....

3 minutes read.

XPath Axes Selenium WebDriver

XPath Axes XPath axes are those axes that are used to search for the multiple nodes in the XML document from the current node context. These methods are mainly used when the...

14 minutes read.

CSS Selector: Sub String in Selenium IDE

CSS Selector: Sub String CSS Selector Sub-string is used to match a partial string to locate a particular web element. There are three ways to match a substring using a CSS Selector. Match...

2 minutes read.

Drag and Drop Event Handling

Drag and Drop Event Handling: In this tutorial, we will learn how to handle the drag and drop event in selenium WebDriver using the action class. Before going further in this tutorial...

6 minutes read.

Selenium-IDE Login test

Login test for Selenium-IDE Now we are learning, how to create a Login/sign-up Test case in Selenium IDE. For our testing purpose, we are going to test the login page provided by...

2 minutes read.

Selenium WebDriver installation

Installation Steps of Selenium WebDriver In this tutorial, we will see the process of selenium webdriver installation. Selenium WebDriver installation process is done in four Stages: Java Installation (version 8 or higher version) Eclipse...

4 minutes read.

WebDriver-Class Name Locator

WebDriver-Class Name Locator In this tutorial, we will learn about the Class name locator of selenium WebDriver. The Class Name locator is used to identify any element in UI based on the...

4 minutes read.

Selenium-IDE Installation in Mozilla Firefox

A beginners guides to Selenium-IDE Installation Since Selenium IDE is designed only for Firefox and Chrome plug-in, we are assuming that you have already installed the Mozilla Firefox browser in your...

1 minute read.

Selenium Assertion

Selenium Assertion: In this section, we will learn about the Assertion in Selenium WebDriver. An Assertion is a feature available in TestNG, which is used to verify the expected result of...

7 minutes read.

CSS Selector: Class in selenium IDE

CSS Selector: Class Identify a web element with the help of Class as a CSS Selector is like using id attribute. The only difference between Class and id is in their...

2 minutes read.

Selenium WebDriver-CSS Selector locator

Selenium WebDriver-CSS Selector locator A CSS selector is used to identify the web element based on their “# id” and “. Class”, Html tags, and attributes. A CSS stands for Cascading Style...

1 minute read.

Selenium WebDriver-Alert Popup

Selenium WebDriver-Alert Popup  An alert popup is one of the small message boxes, which used to give some information to the user that displays on the browser. The Alert popup will be...

6 minutes read.

Xpath locator in Selenium IDE

X PATH LOCATOR: Xpath is used to identify the element using any attribute or visible test. Syntax for X PATH:- //html tag [@attribute=’value’] e.g. - //div [@class=’label’]                    OR //html tag [text () =’Visible Text’] e.g.-//div [text...

2 minutes read.

Difference between Selenium WebDriver and Selenium RC

Difference between Selenium WebDriver, and Selenium RC: Selenium WebDriver and selenium RC (Remote Control) both are different in any manners which we see later in this tutorial, let us see the...

3 minutes read.

WebDriver Interface | Class Diagram

WebDriver interface/class diagram: The interface of WebDriver includes the following stages, which is as follows: Search Context Web driver Remote web driver Driver class Search Context  The first interface of the web driver class is search Context,...

2 minutes read.

WebDriver-Link Text locator

WebDriver-Link Text locator The Link text locator is used to identify only web link elements based on the value of the link. The Link text locators cannot be used for other than...

4 minutes read.

Selenium Tool Suite

The selenium tool suite is a combination of multiple software tools, and the entire tools having a different approach to support automation testing. Selenium test tool suites are as follows- Selenium...

2 minutes read.