×

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

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.

Drawback or Limitations of Selenium

Drawback or Limitations of Selenium Followings are the Drawback or limitations of Selenium:- Drawback /LimitationsDescriptionDesktop applications cannot be automated by Selenium.To test the desktop application, we have tools like Test Complete, Winnium, and...

2 minutes read.

Mouse and Keyboard Controls in Selenium WebDriver

Mouse and Keyboard Controls in Selenium WebDriver In this tutorial, we will learn about how to handle mouse and keyboard event using action class in selenium WebDriver. Action Class in Selenium WebDriver: Action...

13 minutes read.

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...

6 minutes read.

Selenium WebDriver- Microsoft Edge Browser

Selenium WebDriver- Microsoft Edge Browser: In this tutorial, we will learn how to launch the Microsoft Edge browser in the Selenium WebDriver. Before we start automating our test script with Microsoft Edge...

4 minutes read.

Selenium WebDriver - Google Chrome Browser

Selenium WebDriver - Google Chrome Browser In this tutorial, we will learn how to run our Selenium Test Scripts in the Google Chrome Browser. To implement the WebDriver protocol with the help...

3 minutes read.

CSS Selector Locator in Selenium IDE

It used to identify the web element based on HTML tag, id, class, and attributes. To describe the look and formatting of a document written in the markup language are known...

1 minute 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.

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.

Selenium WebDriver - Navigation Controls Commands

Navigation Controls Commands in Selenium WebDriver WebDriver is used to hold the browser history and perform browser navigation operations like, back, forward, and refresh. Whenever a WebDriver launches a browser, all...

5 minutes read.

WebDriver-Id Locator

WebDriver-Id Locator: The Id Locator is used to identify any web element in UI with the help of the ID attribute. The First preference is always goes to ID locator while inspecting...

4 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.

Verification Controls Methods in Selenium WebDriver

Verification Controls Methods  The verification controls methods are used to check whether the web element is displayed, enabled, and selected. Some of the most commonly used verification controls are as follow: Verification controls Description Return...

4 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.

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 WebDriver – Web Element Controls

Selenium WebDriver – Web Element Controls A web element is an interface that is implemented by a remote web element class. The Web element control can be used to perform the data...

1 minute 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 Testing

Selenium is a functional testing tool and compatible with non–functional testing tool. Selenium is free and not required any licensing. There are specified types of testing that can be automated using Selenium:-   Functional Testing: Checking every component...

3 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.

Selenium WebDriver – Window handling

Selenium WebDriver – Window handling In this tutorial, we will understand how we can handle the window, multiple windows, and pop-ups in selenium WebDriver. We have different types of window, and pop-ups...

7 minutes read.