How to Upgrade Maven and Gradle Projects to Selenium 4 (Alpha)

This guide explains how to download Selenium 4 alpha‑7 for various languages and shows step‑by‑step updates for Maven pom.xml and Gradle build.gradle files, including necessary dependencies and a complete demo configuration for Java test automation.

FunTester
FunTester
FunTester
How to Upgrade Maven and Gradle Projects to Selenium 4 (Alpha)

Selenium 4 alpha‑7 is now available for download. The official Selenium website provides language‑specific binaries:

Java:

https://selenium-release.storage.googleapis.com/4.0-alpha-7/selenium-java-4.0.0-alpha-7.zip

Python: https://pypi.org/project/selenium/4.0.0.a7/ C#:

https://www.nuget.org/api/v2/package/Selenium.WebDriver/4.0.0-alpha07

Ruby:

https://rubygems.org/gems/selenium-webdriver/versions/4.0.0.alpha7

Maven upgrade : Change the Selenium version in pom.xml to 4.0.0-alpha-7. Add the selenium-chrome-driver and selenium-remote-driver artifacts if needed.

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

Gradle upgrade : Add the following dependencies to build.gradle (Groovy DSL):

// https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java
implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.0.0-alpha-7'
implementation group: 'org.seleniumhq.selenium', name: 'selenium-chrome-driver', version: '4.0.0-alpha-7'
implementation group: 'org.seleniumhq.selenium', name: 'selenium-remote-driver', version: '4.0.0-alpha-7'
implementation group: 'org.testng', name: 'testng', version: '6.14.3'

test {
  useTestNG()
}

Demo build.gradle showing a complete configuration:

plugins {
  id 'java'
}

group = 'org.demo'
version = '1.0-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
  mavenCentral()
}

dependencies {
  compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.0.0-alpha-7'
  compile group: 'org.seleniumhq.selenium', name: 'selenium-chrome-driver', version: '4.0.0-alpha-7'
  compile group: 'org.seleniumhq.selenium', name: 'selenium-remote-driver', version: '4.0.0-alpha-7'
  compile group: 'org.testng', name: 'testng', version: '6.14.3'
}

test {
  useTestNG()
}

Selenium 4 introduces new capabilities such as enhanced locators, Chrome DevTools integration, and an improved Selenium Grid, making the upgrade worthwhile. The same process applies to other supported languages (Python, C#, PHP, Ruby, JavaScript), allowing developers to quickly adopt the latest features.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Javatest automationGradlemavenSelenium
FunTester
Written by

FunTester

10k followers, 1k articles | completely useless

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.