Install a Selenium library

Setting up the Selenium library for your favourite programming language.

First you need to install the Selenium bindings for your automation project. The installation process for libraries depends on the language you choose to use. Make sure you check the Selenium downloads page to make sure you are using the latest version.

Requirements by language

Installation of Selenium libraries for Java is accomplished using a build tool. You can see all available versions on Maven Repository

For Maven, add the selenium-java dependency in your project pom.xml file:

<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-java</artifactId>
  <version>4.0.0</version>
</dependency>

For Gradle, add the selenium-java dependency in your project build.gradle file:

dependencies {
    compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.0.0'

Installation of Selenium libraries for Python can be done using pip:

pip install selenium

Alternatively you can download the PyPI source archive (selenium-x.x.x.tar.gz) and install it using setup.py:

python setup.py install

Installation of Selenium libraries for C# can be done using NuGet in one of two ways

  • Using a Packet Manager:
Install-Package Selenium.WebDriver
  • Using .NET CLI
dotnet add package Selenium.WebDriver

Installation of Selenium libraries for Ruby can be done using gem:

gem install selenium-webdriver

Or add it to your Gemfile:

gem 'selenium-webdriver', '~> 4.0'

Installation of Selenium libraries for JavaScript can be done using npm:

npm install selenium-webdriver
Use the Java bindings for Kotlin.

Next Step

Install the browser drivers

Last modified January 12, 2022: Example code (#920) [deploy site] (d22cd1c186e)