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
  1. By.id()
  2. By.name()
  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: By.id().
  2. Name
    Locates elements whose ID attribute matches the search value.
    Method name: By.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 | 06th-Jul-2024
#Selenium
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
#Testing
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...

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

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

View More