Getting started with Selenium WebDriver.

Author: neptune | 02nd-Apr-2023
#Selenium #Testing

What is Selenium?

Selenium is an open-source automated suite of tools that are widely used in Web application automaton testing. It is developed on Java, Ruby, Python languages.

Advantages of Selenium ?

  • It is open-source.
  • It supports cross-browser testing.
  • It support Parallel Test Execution. 
  • It supports multiple OS (Windows, Mac, Linux/Unix).
  • Also support cross-device testing.

  • Compatible with C#, Java, JavaScript, Ruby, Python, PHP.
  • Support Mouse cursor and keyboard actions.
  • Run the test in Local as well as in Servers (Jenkins).
  • Large active user community support.
  • Easy to Implement.

Disadvantages of Selenium ?

  • Didn't support Windows and Mobile applications.
  • Didn't support Window based Pop-up.
  • Don't have it's reporting tools.
  • Can't handle two factor authentication.
  • Can't handle dynamic web content.
  • Continuous Maintenance of Code required.
  • Inability to Test UX.
  • Didn't support Bar code reading.

What is Selenium 2.0 ?

Web Testing tools Selenium RC and WebDriver are consolidated in single tool in Selenium 2.0. Basically it represent the merger of WebDriver project and original Selenium project.

What are the Components of Selenium?

There are four components of Selenium:-
  1. Selenium IDE, 
  2. Selenium RC, 
  3. Selenium WebDriver, It provide the API's for a variety of languages like Java, Python, .NET, PHP, etc.
  4. Selenium Grid

  1. Selenium IDE: Selenium IDE (Integrated Development Environment) is primarily used to develop test cases. Selenium IDE is an easy to use tool from the Selenium Test Suite. We can automate tests for our  web applications easily.

  2. Selenium RC:  It is a testing framework that enables a QA or a developer to write test cases in any programming language in order to automate UI tests for web applications against any HTTP website.


  3. Selenium WebDriver: It is a widely used component. It is used to overcome the disadvantages of Selenium RC. Selenium WebDriver does not have a server and it communicates with the browser and runs it. It supports multiple OS platforms and browsers.

  4. Selenium Grid: Selenium Grid is a smart proxy server that makes it easy to run tests in parallel on multiple machines. This is done by routing commands to remote web browser instances, where one server acts as the hub. This hub routes test commands that are in JSON format to multiple registered Grid nodes.

Different types of locators in Selenium.

Different types of locators are
  3. By.tagName()
  4. By.className()
  5. By.linkText()
  6. By.partialLinkText()
  7. By.xpath
  8. By.cssSelector()
 There are eight different built-in element location strategies in WebDriver:
  1. ID
    Locates elements whose ID attribute matches the search value.
    Method name:
  2. Name
    Locates elements whose ID attribute matches the search value.
    Method name:
  3. TagName
    Locates elements whose tag name matches the search value.
    Method name: By.tagName().
  4. ClassName
    Locates elements whose class name contains the search value (compound class names are not permitted).
    Method name: By.className().
  5. LinkText
    Locates anchor elements whose visible text matches the search value.
    Method name: By.linkText().
  6. Partial Link Text
    Locates anchor elements whose visible text contains the search value. If multiple elements are matching, only the first one will be selected.
    Method name: By.partialLinkText().
  7. Xpath
    Locates elements matching an XPath expression.
    Method name: By.xpath().
  8. CSS Selector
    Locates elements matching a CSS selector.
    Method name: By.cssSelector().

Note:- One of the most fundamental techniques to learn when using WebDriver is how to find elements on the page. WebDriver offers a number of built-in selector types, amongst them finding an element by its ID attribute is widely used.

Thanks for Reading !!! If you have any Questions Let me know in comment section.

anonymous | Feb. 20, 2022, 9:54 p.m.

Add more blogs of Selenium Webdriver.

Related Blogs
Automate Ticket Booking in SpiceJet from Delhi to Bengaluru using Selenium and Cucumber.
Author: neptune | 08th-Aug-2023
We are going to automate a ticket booking using Selenium WebDriver and Cucumber BDD...

Roadmap To Become Test Automation Engineer
Author: neptune | 25th-Jun-2022
When I was starting my journey in test automation, a lot of questions comes to my mind. Such as…. “From where do I start?” “Best tools to use?” “Which Programming language?” “How to plan your work?”...

Selenium, Cucumber, JUnit, TestNG dependencies for Selenium project.
Author: neptune | 02nd-Apr-2023
#Selenium #Testing
We guide you how to update the pom.xml file for Selenium Maven project...

5 Selenium Project Ideas & for Beginners in Automation Testing
Author: neptune | 30th-Mar-2023
#Selenium #Testing #Projects
In this article, we will discuss 5 interesting Selenium project ideas for beginners in automation testing...

How to use wait commands in Selenium WebDriver in Java ?
Author: neptune | 22nd-Feb-2022
#Selenium #Testing #Java
We are going to explore different types of waits in Selenium WebDriver. Implicit wait, Explicit wait, and Fluent wait with examples...

Top 50+ Selenium Interviews Questions 2023 based on Years of Experience
Author: neptune | 02nd-Apr-2023
#Selenium #Testing #Interview
Every interview difficulty is based on how many years of experience you have in that field. For the Selenium Automation Tester I have divided the question on the number of years of experience...

Different types of software testing ?
Author: neptune | 27th-Jul-2022
#Testing #IT
Testing is the process to improve the performance of software. Examples: Unit, Integration, Regression, Smoke, Alpha, Beta, System, Stress Performance, Object-Oriented Testing etc...

Top 10 Selenium Interview Questions with answers (2021).
Author: neptune | 02nd-Apr-2023
#Selenium #Interview
In this article I will cover top 10 Selenium interview questions...

Mostly asked Cucumber interview questions in selenium automation interviews.
Author: neptune | 02nd-Apr-2023
We are going to explore widely asked Cucumber interview questions in selenium automation interviews...

How to create Selenium Cucumber Project in Eclipse.
Author: neptune | 25th-May-2022
First, divide the process into the various steps to understand working in brief of a project. Steps in brief: We’ll start with initializing the browser driver and then log in to the web page...

Challenges faced in automating Web Applications using Selenium
Author: neptune | 02nd-Oct-2022
#Selenium #Testing
List of Challenges faced by testers using Selenium 1. Popup and Alert Handling, 2. Dynamic element Handling 3. Restricted to only Desktop Browsers Testing...

How to create a Selenium, Cucumber Automation project in Eclipse ?
Author: neptune | 02nd-Apr-2023
#Selenium #Testing
Problem Statement : Let’s consider this particular project where we will try automating the process of booking a flight ticket. Let’s get started and see how it’s done using Selenium...

20 TestNG Interview Questions
Author: neptune | 17th-Dec-2022
#Selenium #Interview
There is always more than one test or method in the class. If we do not prioritize these tests or methods, then the methods are selected alphabetically and executed while execution...

What is Test Plan in Testing?
Author: neptune | 30th-Oct-2022
A Test Plan Document mentions in detail the objective of testing along with other core information like the internal beta team, target market, hardware and resource requirements, etc...

Why we use Robot Class in Automation Testing?
Author: neptune | 23rd-Aug-2022
Robot class is used to generate native system input events for the purpose of automation testing. It is used to perform mouse and keyboard events on windows applications or popups...

5 Best Python Testing Frameworks.
Author: neptune | 12th-Apr-2023
#Python #Testing
Python offers various testing frameworks, including Pytest, unittest, Nose, Robot Framework, and Behave, to build robust and reliable software...

Top 10 Selenium Interview Questions.
Author: neptune | 02nd-Apr-2023
#Selenium #Interview
Locator is a command that tells Selenium IDE which GUI elements (like Text Box, Buttons, Check Boxes etc) we are going to use or perform some automation task...

How to send POST request using Rest Assured framework in Java ?
Author: neptune | 26th-Mar-2023
#Selenium #API
Rest Assured is a popular Java-based framework that is used for testing RESTful web services. It provides a simple and intuitive API for sending HTTP requests and validating the responses...

How DAST Testing Enhances Web Application Security?
Author: neptune | 02nd-Aug-2023
Dynamic Application Security Testing (DAST) is a critical cybersecurity technique used to identify and assess security vulnerabilities in web applications...

The Key to QA Success: Understanding How Important Grooming Is?
Author: neptune | 19th-Sep-2023
#Testing #Interview
We will delve into the importance of grooming & ceremony for QA testers, key points to highlight their significance...

Getting Started with Cypress: Advantages, Setup, and First Test Guide
Author: neptune | 31st-Mar-2023
Cypress is a powerful and easy-to-use testing framework that can help you test your web applications more efficiently...

View More