Javatpoint Logo

Selenium Tutorial

Selenium ide, selenium webdriver, selenium python, selenium c#, selenium maven.

Interview Questions

JavaTpoint

  • Send your Feedback to [email protected]

Help Others, Please Share

facebook

Learn Latest Tutorials

Splunk tutorial

Transact-SQL

Tumblr tutorial

Reinforcement Learning

R Programming tutorial

R Programming

RxJS tutorial

React Native

Python Design Patterns

Python Design Patterns

Python Pillow tutorial

Python Pillow

Python Turtle tutorial

Python Turtle

Keras tutorial

Preparation

Aptitude

Verbal Ability

Interview Questions

Company Questions

Trending Technologies

Artificial Intelligence

Artificial Intelligence

AWS Tutorial

Cloud Computing

Hadoop tutorial

Data Science

Angular 7 Tutorial

Machine Learning

DevOps Tutorial

B.Tech / MCA

DBMS tutorial

Data Structures

DAA tutorial

Operating System

Computer Network tutorial

Computer Network

Compiler Design tutorial

Compiler Design

Computer Organization and Architecture

Computer Organization

Discrete Mathematics Tutorial

Discrete Mathematics

Ethical Hacking

Ethical Hacking

Computer Graphics Tutorial

Computer Graphics

Software Engineering

Software Engineering

html tutorial

Web Technology

Cyber Security tutorial

Cyber Security

Automata Tutorial

C Programming

C++ tutorial

Control System

Data Mining Tutorial

Data Mining

Data Warehouse Tutorial

Data Warehouse

RSS Feed

Search code, repositories, users, issues, pull requests...

Provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications

WebDriver BiDi is the future of cross-browser automation. Read all about it!

Below is where you can find the latest releases of all the Selenium components.

You can also find a list of previous releases, source code, and additional information for Maven users.

Selenium Clients and WebDriver Language Bindings

In order to create scripts that interact with the Selenium Server (Remote WebDriver) or create local Selenium WebDriver scripts, you need to make use of language-specific client drivers.

While language bindings for other languages exist , these are the core ones that are supported by the main project hosted on GitHub.

Stable: 4.18.1 (February 19, 2024)

Selenium Server (Grid)

The Selenium Server is needed in order to run Remote Selenium WebDriver (Grid).

Latest stable version 4.18.1

To use the Selenium Server in a Grid configuration see the documentation .

The Internet Explorer Driver Server

This is required if you want to make use of the latest and greatest features of the WebDriver InternetExplorerDriver.

Please make sure that this is available on your %PATH% in order for the IE Driver to work as expected.

Download version 4.14.0.0 for:

32 bit Windows IE (recommended)

64 bit Windows IE

Selenium IDE

Selenium IDE is a Chrome, Firefox and Edge plugin which records and plays back user interactions with the browser. Use this to either create simple scripts or assist in exploratory testing.

Download latest released version for Chrome or Firefox or Edge . View the Release Notes.

Download previous IDE versions .

Selenium Nightly Builds

If you need a bug fix or a feature that just landed on the codebase, or if you wish to test the next release before it is out, check the Selenium Nightly Builds.

While we always strive to keep code in a releasable state, bugs or undocumented changes might be present when you use a nightly build.

WebDriver & DevTools

You will need to authenticate to the GitHub RubyGems registry, instructions can be seen at the GitHub documentation .

Nightly builds are pushed to TestPyPI .

Work in progress.

WebDriver & Grid

Nuget latest release is 4.18.1 Released on February 19, 2024.

WebDriverBackedSelenium (Final version 4.1.0 Released on November 22, 2021)

RC (Final version 3.1.0 Released on February 16, 2017)

Previous Releases

Release date: march 21, 2024.

Selenium 4.18.0

Release date: February 19, 2024

Selenium 4.17.0

Release date: January 23, 2024

Selenium 4.16

Release date: December 6, 2023

Selenium 4.15

Release date: November 1, 2023

Selenium 4.14

Release date: October 10, 2023

Selenium 4.13

Release date: September 25, 2023

Selenium 4.12.0

Release date: August 31, 2023

Selenium 4.11.0

Release date: July 31, 2023

Selenium 4.10.0

Release date: June 7, 2023

Selenium 4.9.0

Release date: April 20, 2023

Selenium 4.8.0

Release date: January 23, 2023

Selenium 4.7.0

Release date: December 1, 2022

Selenium 4.6.0

Release date: November 4, 2022

Selenium 4.5.0

Release date: September 28, 2022

Selenium 4.4.0

Release date: August 9, 2022

Selenium 4.3.0

Release date: June 23, 2022

Selenium 4.2.0

Release date: May 27, 2022

Selenium 4.1.0

Release date: November 22, 2021

Selenium 4.0.0

Release date: October 13, 2021

Selenium 4.0.0 RC3

Release date: October 8, 2021

Selenium 4.0.0 RC2

Release date: September 30, 2021

Selenium 4.0.0 RC 1

Release date: September 1, 2021

Selenium 4.0.0 Beta 4

Release date: June 4, 2021

Selenium 4.0.0 Beta 3

Release date: April 13, 2021

Selenium 4.0.0 Beta 2

Release date: March 16, 2021

Selenium 4.0.0 Beta 1

Release date: February 15, 2021

Selenium 4.0.0 Alpha 7

Release date: November 10, 2020

Selenium 4.0.0 Alpha 6

Release date: May 28, 2020

Selenium 4.0.0 Alpha 5

Release date: March 17, 2020

Selenium 4.0.0 Alpha 4

Release date: January 9, 2020

Selenium 4.0.0 Alpha 3

Release date: September 26, 2019

Selenium 3.150.0

Release date: August 22, 2019

Selenium 4.0.0 Alpha 2

Release date: July 1, 2019

Selenium 4.0.0 Alpha 1

Release date: April 18, 2019

Selenium 3.141.59

Release date: November 14, 2018

Selenium 3.141.5

Release date: November 6, 2018

Selenium 3.141.0

Release date: October 30, 2018

Selenium 3.14.0

Release date: August 1, 2018

Selenium 3.13.0

Release date: June 25, 2018

Selenium 3.12.0

Release date: May 8, 2018

Selenium 3.11.0

Release date: March 11, 2018

Selenium 3.10.0

Release date: March 2, 2018

Selenium 3.9.1

Release date: February 7, 2018

Selenium 3.9.0

Release date: February 5, 2018

Selenium 3.8.1

Release date: December 1, 2017

Selenium 3.8.0

Release date: November 28, 2017

Selenium 3.7.1

Release date: November 6, 2017

Selenium 3.7.0

Release date: November 2, 2017

Selenium 3.6.0

Release date: September 22, 2017

Selenium 3.5.3

Release date: August 29, 2017

Selenium 3.5.2

Release date: August 21, 2017

Selenium 3.5.1

Release date: August 16, 2017

Selenium 3.5.0

Release date: August 10, 2017

Selenium 3.4.0

Release date: April 21, 2017

Selenium 3.3.1

Release date: March 10, 2017

Selenium 3.3.0

Release date: March 7, 2017

Selenium 3.2.0

Release date: February 23, 2017

Selenium 3.1.0

Release date: February 15, 2017

Selenium 3.0.1

Release date: October 18, 2016

Selenium 3.0.0

Release date: October 13, 2016

Selenium 3.0.0-beta-4

Release date: September 29, 2016

Selenium 3.0.0-beta-3

Release date: September 1, 2016

Selenium 3.0.0-beta-2

Release date: August 2, 2016

Selenium 3.0.0-beta-1

Release date: July 29, 2016

Selenium 2.53.1

Release date: June 30, 2016

Selenium 2.53.0

Release date: March 15, 2016

Selenium 2.52.2

Release date: March 7, 2016

Selenium 2.52.1

Release date: February 23, 2016

Selenium 2.52.0

Release date: February 11, 2016

Selenium 2.51.0

Release date: February 5, 2016

Selenium 2.50.1

Release date: January 29, 2016

Selenium 2.50.0

Release date: January 27, 2016

Selenium 2.49.1

Release date: January 21, 2016

Selenium 2.49.0

Release date: January 13, 2016

Selenium 2.48.2

Release date: October 9, 2015

Selenium 2.48.1

Release date: October 8, 2015

Selenium 2.48.0

Release date: October 7, 2015

Selenium 2.47.1

Release date: July 30, 2015

Selenium 2.47.0

Release date: July 29, 2015

Selenium 2.46.0

Release date: June 4, 2015

Selenium 2.45.0

Release date: February 26, 2015

Selenium 2.44.0

Release date: October 23, 2014

Selenium 2.43.1

Release date: September 10, 2014

Selenium 2.43.0

Release date: September 9, 2014

Selenium 2.42.2

Release date: June 2, 2014

Selenium 2.42.1

Release date: May 29, 2014

Selenium 2.42.0

Release date: May 22, 2014

Selenium 2.41.0

Release date: March 27, 2014

Selenium 2.40.0

Release date: February 19, 2014

Selenium 2.39.0

Release date: December 16, 2013

Maven information.

If you're using Maven or Gradle, you will find more information on MVNRepository . When the most recent version of Selenium is not there yet, you can also check the Selenium Maven repository .

Over the last decade, a large ecosystem of Open Source projects have sprouted up around Selenium. Check them out at the Ecosystem page .

Platforms Supported by Selenium

GeckoDriver is implemented and supported by Mozilla, refer to their documentation for supported versions.

Internet Explorer

Only version 11 is supported, and it requires additional configuration .

SafariDriver is supported directly by Apple, for more information, check their documentation

OperaDriver is supported by Opera Software, refer to their documentation for supported versions.

ChromeDriver is supported by the Chromium project, please refer to their documentation for any compatibility information.

Microsoft is implementing and maintaining the Microsoft Edge WebDriver, please refer to their documentation for any compatibility information.

Operating Systems

Microsoft Windows

Most versions of MS Windows that are currently still supported by Microsoft should work with Selenium. Although we use the latest MS Windows to troubleshoot things, it does not mean Selenium won't attempt to support different versions of Windows. This only means we don't continually run tests on other particular version of Windows.

We currently do not use any version of macOS in our automated tests against the Selenium project. However most developers on the project are using a recent version of macOS and we'll continue to support the current stable release and often the previous release.

We test mainly on Ubuntu, but other variations of Linux should also work where the browser manufacturers support them.

Source Code

You can also find a list of the Selenium source code at our GitHub repository .

Selenium Level Sponsors

Support the selenium project.

Want to support the Selenium project? Learn more or view the full list of sponsors.

  • Trending Now
  • Foundational Courses
  • Data Science
  • Practice Problem
  • Machine Learning
  • System Design
  • DevOps Tutorial
  • Web Browser
  • Single Program Multiple Data (SPMD) Model
  • Hybrid Blockchain
  • SciPy - Cluster
  • How to Reduce Code Duplication in Scala?
  • Stacked Bar Chart With Selection Using Altair in Python
  • Git - Move Files
  • Git - LFS (Large File Storage)
  • Git - Hooks
  • 5 Best Email Marketing Software
  • Principal Components Analysis in Data Mining
  • How to Use FlycoSystemBar Library in Android App?
  • How to Handle Big Repositories with Git?
  • What are Bitcoin Mitigating Attacks?
  • How to Create a Waffle Chart in Excel
  • How to Add Trendline in Excel Chart
  • How To Create Dot Plots In Excel?
  • How To Create a Tornado Chart In Excel?
  • How to Fix “Failed to install the following Android SDK packages as some licenses have not been accepted” Error in Android Studio?

Locating Strategies By Tag Name Using Java

Web application testing must be rigorous and thorough. For this reason, many tests for web applications are automated. Selenium is an open-source framework that allows us to automate web browser testing.

Table of Content

Steps for Locating Elements By Tag Name in Java

Faq’s on locating strategies by tag name.

In the following sections, we will look at how to use tag names to locate elements in our HTML code using Java and Selenium. Then we will also see how we can access text inside those tags.

Step 1: Create a Project

Create a Maven project in your Java IDE. For this tutorial, I will be using the Community Edition of IntelliJ Idea IDE. Alternatively, you could use others like Eclipse IDE or the NetBeans IDE that are open source. Navigate to File > New > Project to initiate the project setup.

Screenshot-2024-03-10-210631

Navigating to creating the New Project option

Step 2: Set Up the Project Configuration

Next, we will look at the configuration settings for our project. When you click the Project button from the previous step, a new dialogue box will open. In this, choose a name for your project and the build type as Maven.

The main configuration that we will set here is the build-system and the java language level that we want to use in our project.

Maven is a build tool for Java. You specify what libraries you need in your pom.xml file. Maven reads this file and downloads these libraries and automatically adds them to the classpath. This saves you from manually doing these steps. From the classpath, the JRE is able to use these external libraries to run the project.

The language level we will choose is Java-17. This looks like as follows:

Screenshot-2024-03-10-210718

Project Settings

When you are done, click on the create button at the bottom of the dialogue box.

Step 3: Add the Selenium Dependency

Now add the following selenium dependency in the pom.xml file:

Now, your pom.xml file should match the following:

Screenshot-2024-03-10-210917

Step 4: Building The main class

Now we will develop the main class. We will create a simple automation in this example. It consists of the following steps:

  • Open the browser
  • Locate elements using the tag name
  • See how to access text inside it
  • Close the browser

Without any human interactions. Modify the existing code in your main class as:-

Step 5: Testing the Automation

Now, we will test the automation we have just created. Upon running the code, we get the output of this is as:

Screenshot-2024-03-07-214056

Text inside the first div

Step 6: Error Handling

Now, what happens if try to look for a tag that does not exist in our code?

We see an ugly error on the console and the code behaves weirdly. The error looks like as follows:

Screenshot-2024-03-12-165703

NoSuchElementException

To avoid such situations, we can enclose our code in a try-catch block.

Modify the code above as:

Now when you try to run the code you see a simple message that tells you the source of your problem and does not cause the application to behave weirdly. The message logged on the console is as follows:

Screenshot-2024-03-12-170118

Locating strategies with partial link text on various Browsers

Selenium Web Driver currently provides support for Google Chrome, Internet Explorer, Safari, Microsoft Edge, and Firefox Browser. The dependency we have used in this tutorial is sufficient for all of these drivers. If you wish to have only browser-specific libraries in your application, you could add the specific libraries for each of these drivers:

1. Chrome Driver

<!– https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver –> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-chrome-driver</artifactId> <version>4.18.0</version> </dependency>

2. IE Driver

<!– https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-ie-driver –> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-ie-driver</artifactId> <version>4.18.0</version> </dependency>

3. Safari Driver

<!– https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-safari-driver –> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-safari-driver</artifactId> <version>4.18.0</version> </dependency>

4. Microsoft Edge Driver

<!– https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-edge-driver –> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-edge-driver</artifactId> <version>4.18.0</version> </dependency>

5. Firefox Driver

<!– https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-firefox-driver –> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-firefox-driver</artifactId> <version>4.18.0</version> </dependency>

Just add any of these for the browser that you want to automate and you are good to go.

In this article, we looked at how we can locate elements using tag names. If you have any queries, please feel free to comment below.

Q1. Why does this feature even exist if we can use Xpath?

Ans: We can indeed locate many possible elements using XPath. But, the downside of this is that your code becomes very hard to read and maintain. Furthermore, modern websites have a very large HTML code. This makes it difficult to identify and keep track of the tree structure of the document. This is why locating elements by tag names makes it simpler and a more beginner-friendly alternative than xpath.

Q2. What happens if I have multiple tags of the same type?

Ans: If you have multiple tags of the same type then the one which appears the first in your code is returned by default.

Q3. Can I use this on the title tag?

Ans: Yes you can use it for the title tag but it is not recommended. This is because the title tag lies inside the HTML head tag and is processed differently than the contents of the HTML body tag. It is best to limit the use of the locating strategy by tag name to the contents of the body tag only.

Please Login to comment...

author

  • 10 Best Zoho Vault Alternatives in 2024 (Free)
  • 10 Best Twitch Alternatives in 2024 (Free)
  • Top 10 Best Cartoons of All Time
  • 10 Best AI Instagram Post Generator in 2024
  • 30 OOPs Interview Questions and Answers (2024)

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

IMAGES

  1. Complete Selenium WebDriver with Java Bootcamp

    selenium safari driver java

  2. Selenium Webdriver Running test on Safari Browser

    selenium safari driver java

  3. How to download download selenium java client driver

    selenium safari driver java

  4. How to launch Selenium Script in Safari Browser Using SafariDriver

    selenium safari driver java

  5. SafariDriver: How to Run Selenium Tests in Safari

    selenium safari driver java

  6. First Selenium WebDriver Code using Java with Latest JARs in Eclipse

    selenium safari driver java

VIDEO

  1. 9) Selenium Introduction and Setup using java

  2. driver.get() vs driver.navigate().to() in Selenium WebDriver || Selenium Java

  3. SAFARI DRIVER POWER...KATANYA LEBIH NDUUUT CEEES,.#powerampli #poweramplifier #diy #ampli #amplimini

  4. 02- Intégration de Selenium (Library + Driver ) JAVA & Chrome

  5. Selenium Latest 4.10.0

  6. Selenium Installation

COMMENTS

  1. How to Run Safari Driver in Selenium Using Java?

    So that the output can be visible easily. At last, the opened Safari window has to be closed. For that reason, the quit () method is going to be implemented. Below is the complete implementation of the above approach: Java. import java.io.*; import java.lang.Thread; import org.openqa.selenium.WebDriver;

  2. Safari specific functionality

    These are capabilities and features specific to Apple Safari browsers. Unlike Chromium and Firefox drivers, the safaridriver is installed with the Operating System. To enable automation on Safari, run the following command from the terminal: safaridriver --enable.

  3. How to launch Safari with Selenium WebDriver using Java

    It can be turned on by opening Safari preferences (Safari > Preferences in the menu bar), going to the Advanced tab, and ensuring that the Show Develop menu in menu bar checkbox is checked. Enable Remote Automation in the Develop menu. This is toggled via Develop > Allow Remote Automation in the menu bar.

  4. About WebDriver for Safari

    WebDriver is a REST API. It hosts a local web server that accepts REST-style HTTP requests, so it can accept automation commands from a wide variety of test setups. To support WebDriver without sacrificing a user's privacy or security, Safari's driver provides extra safeguards to ensure that test execution is isolated from normal browsing ...

  5. How to Run Selenium Tests on Safari using SafariDriver

    Let's assume the use of Selenium with Java for the upcoming examples. Let's consider a simple test scenario with three steps: Launch Safari browser. Visit https://www.google.com. Enter the search query "BrowserStack". Click on the search button. Close the browser. A Java program for the above test scenario is as follows:

  6. Testing with WebDriver in Safari

    Selenium's Java and Python client libraries offer support for Safari's native driver implementation starting in the 3.0.0-beta1 release. Important. Don't use the old SafariDriver implementation, which is no longer supported by the Selenium project. The Apple-developed driver is a replacement for the legacy SafariDriver formerly maintained ...

  7. SafariDriver

    public class SafariDriver extends RemoteWebDriver implements HasPermissions, HasDebugger. A WebDriver implementation that controls Safari using a browser extension (consequently, only Safari 5.1+ is supported). This driver can be configured using the SafariOptions class.

  8. java

    Configure and enable Safari WebDriver: If you are on macOS v10.13 (High Sierra) and later run 'safaridriver --enable' command in terminal. Open the Safari browser and follow the below steps: Safari → Preferences then on the Advanced tab, select 'Show Develop menu in menu bar'. From the menu bar, choose Develop → 'Allow Remote Automation'.

  9. Test Automation on Safari Browser with Safari Driver and Selenium

    Step 1: Download and Install the Safari Browser Extension. Step 2: Enable the WebDriver Browser Extension by going to Safari > Preferences and open the preferences window and then enable the "Enable WebDriver" option. Step 3: Restart your Browser.

  10. Learn Selenium with Java to run Automated Tests

    Pre-requisites for Setup and Configuration of Selenium in Java. Step 1 - Install Java. Step 2 - Install Eclipse. Step 3 - Selenium Client and WebDriver Language Bindings. Step 4 - Configuring Selenium WebDriver With Eclipse. Step 5 - Creating and Running the first test using Selenium and Java. Best Practices while writing Selenium ...

  11. SafariDriver: How to Run Selenium Tests in Safari

    The "Develop" menu now visible in Safari. Then click the "Allow Remote Automation" option. This short drill gets your Mac ready to run Selenium tests without any downloads. This process would be more complex on Chrome and Safari as their corresponding drivers don't come installed by default. A few things to know when running tests: 1 ...

  12. Selenium Webdriver Tutorial in Java with Examples

    Create a WebDriver instance. Navigate to a webpage. Locate a web element on the webpage via locators in selenium. Perform one or more user actions on the element. Preload the expected output/browser response to the action. Run test. Record results and compare results from them to the expected output.

  13. Selenium WebDriver- Running test on Safari Browser

    Type the value "javatpoint tutorials". Click on the Search button. Close the browser. We will create our fifth test case in the same test suite (Demo_Test). Step1. Right click on the "src" folder and create a new Class File from New > Class. Give your Class name as "Fifth" and click on "Finish" button. Step2.

  14. Selenium Safari Driver

    Selenium Safari Driver. Selenium automates browsers. That's it! What you do with that power is entirely up to you. License: Apache 2.0: Tags: selenium testing driver: ... Absolute Beginner (Part 1) Java 4 Selenium WebDriver: Come Learn How To Program For Automation Testing (Black & White Edition) (Practical How To Selenium Tutorials) (2016) by ...

  15. selenium/SafariDriver.java at trunk · SeleniumHQ/selenium · GitHub

    DriverFinder; import org. openqa. selenium. remote. service. DriverService; * (consequently, only Safari 5.1+ is supported). * This driver can be configured using the {@link SafariOptions} class. * Initializes a new SafariDriver} class with default {@link SafariOptions}. * Initializes a new SafariDriver using the specified {@link SafariOptions}.

  16. How to Run Selenium Tests on Safari using SafariDriver

    Let's consider a simple test scenario with three steps: Launch Safari browser. Visit https://www.google.com. Enter the search query "Yahoo". Click on the search button. Close the browser. A Java program for the above test scenario is as follows: import org.openqa.selenium.By; import org.openqa.selenium.WebDriver;

  17. Downloads

    Selenium IDE is a Chrome, Firefox and Edge plugin which records and plays back user interactions with the browser. Use this to either create simple scripts or assist in exploratory testing. Download latest released version for Chrome or Firefox or Edge. View the Release Notes. Download previous IDE versions.

  18. java

    It appears that the SafariDriver for Selenium doesn't wait for web pages to load. My test is as follows: import org.junit.After; import org.junit.Before; import org.junit.Test; import org.openqa.

  19. Locating Strategies By Tag Name Using Java

    Selenium Web Driver currently provides support for Google Chrome, Internet Explorer, Safari, Microsoft Edge, and Firefox Browser. The dependency we have used in this tutorial is sufficient for all of these drivers. If you wish to have only browser-specific libraries in your application, you could add the specific libraries for each of these ...

  20. java

    Could not start server: must specify at least one configuration argument. Usage: safaridriver [options] -h, --help Prints out this usage information. -p, --port Port number the driver should use. If the server is already running, the port cannot be changed. If port 0 is specified, a default port will be used.

  21. java

    I was also facing issues in initiating safari browser on mac machine, and below solution helped me. Everytime I was calling driver init, browser was getting opened but the URL was not getting hit. I am using Page object factory, with selenium , Java , maven and testng.