Gradle with Selenium


I am trying to use Gradle(4.5.1) with Selenium (Java) and Chromedriver ( chrome v 64, chromedriver 2.35). This is how my dependency section looks in build.gradle

dependencies {
compile '’
compile '’
compile '’
compile group: ‘org.seleniumhq.selenium’, name: ‘selenium-java’, version: '2.9.0’
compile group: ‘org.seleniumhq.selenium’, name: ‘selenium-chrome-driver’, version: ‘2.9.0’


I am using ancient selenium libraries (2.9.0). Whenever I try to use selenium libraries 3.0+, I get below exception when I do gradle run:

Exception in thread “main” java.lang.NoSuchMethodError:;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
at org.openqa.selenium.remote.service.DriverService.findExecutable(
at org.openqa.selenium.remote.service.DriverService$
at Quickstart.main(

My selenium code is really simple two liner:

System.setProperty(“”, “C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe”);
WebDriver driver = new ChromeDriver();


More details here:

Please guide, what could be missing, why latest selenium jars are not working. Gradle is using Maven repository,

Thank you!

Anyone? Waiting for a reply.

Mostly these kind of errors indicate a library conflict. Please activate failOnVersionConflict and report whether gradle reports some conflict.