As mentioned earlier: Selenium4 Frontier Express, At the time of this writing, Selenium 4.0.0-alpha-7 is the latest Selenium4 (alpha) release available for download on the official Selenium website. Selenium 4 for different languages is shown below:

Language Selenium 4 (Alpha) Download Link
Java Selenium-release.storage.googleapis.com/4.0-alpha-7…
Python Pypi.org/project/sel…
C# www.nuget.org/api/v2/pack…
Ruby Rubygems.org/gems/seleni…

Maven — Upgrade to Selenium 4

If you use Selenium in conjunction with Java, you will most likely use Selenium and Maven to manage the dependencies associated with the Selenium project. For Maven users, simply change the Selenium version in POM.xml to 4, as follows:

<! -- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.0.0 - alpha - 7</version>
</dependency>

Copy the code

In addition to Selenium 4 Java, we can also add the Selenium 4 package for Selenium-Chrome-driver and Selenium-Remote-Driver in the POM file.

Gradle — Upgrade to Selenium 4

Gradle is a popular build tool for Java-based applications. Build scripts in Gradle are written in Groovy or Kotlin DSLS. For Gradle users, modify the build. Gradle file to configure the necessary dependencies, and multiple projects modify the build. Gradle file in the root directory.

// https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java
implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.0.0 - alpha - 7'
Copy the code

Demo

Below is a build file for the Gradle project (build.gradle) in which we use the 4.0.0-alpha-7 version of the Selenium Java binding. This includes dependencies on the testNG testing framework.

plugins {
    id 'java'
}
  
group 'org.demo'
version 1.0 the 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()
}
Copy the code

That’s all people

Selenium 4 offers several new features: locators, Chrome DevTools, improved Selenium Grid, and more, making it a worthwhile upgrade.

In addition to Java, it is also easy to upgrade to Selenium 4 for languages supported by Selenium, such as Python, C#, PHP, Ruby, and JavaScript, and those interested can do their own research!

Have Fun ~ Tester!

FunTester“, a group of interesting souls, Tencent Cloud &Boss certified author, GDevOps official partner media.


  • A preliminary study of the FunTester test framework architecture diagram
  • FunTester share the second video review
  • Three ways to first meet Postman, SayHi
  • The artifact of the future fiddler Everywhere
  • JMeter throughput error analysis
  • Selenium automation: code testing versus non-code testing
  • Iot testing
  • Jmeter based on Webket test background service interface actual combat
  • Binding phone number performance test
  • Java multithreaded programming applied in JMeter
  • E-book website crawler practice
  • Asynchronous authentication of Socket interfaces
  • Groovy handles cookies in JMeter

Click to read for an original collection of FunTester history