Share

Getting started with Selenium WebDriver.

Author: neptune | 15th-Apr-2022 | views: 262
#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 | 17th-May-2022 | views: 4369
#Selenium #Cucumber
We are going to automate a ticket booking using Selenium WebDriver and Cucumber BDD...
Selenium, Cucumber, JUnit, TestNG dependencies for Selenium project.
Author: neptune | 25th-May-2022 | views: 1576
#Selenium #Testing #Cucumber #Projects
We guide you how to update the pom.xml file for Selenium Maven project...
How to use wait commands in Selenium WebDriver in Java ?
Author: neptune | 22nd-Feb-2022 | views: 889
#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 2022 based on Years of Experience
Author: neptune | 31st-May-2022 | views: 824
#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 | views: 761
#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 | 23rd-Feb-2022 | views: 724
#Selenium
In this article I will cover top 10 Selenium interview questions...
Mostly asked Cucumber interview questions in selenium automation interviews.
Author: neptune | 28th-May-2022 | views: 632
#Selenium #Testing #Cucumber
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 | views: 362
#Selenium #Cucumber
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...
How to create a Selenium, Cucumber Automation project in Eclipse ?
Author: neptune | 19th-Apr-2022 | views: 244
#Selenium #Testing #Cucumber
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...
Roadmap To Become Test Automation Engineer
Author: neptune | 25th-Jun-2022 | views: 240
#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?”...
Top 10 Selenium Interview Questions.
Author: neptune | 03rd-Jun-2022 | views: 155
#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...
Why we use Robot Class in Automation Testing?
Author: neptune | 23rd-Aug-2022 | views: 90
#Selenium
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...
View More