NoSuchMethodError: org.openqa.selenium.os.CommandLine.findExecutable(Ljava/lang/String;)Ljava/lang/String; while launching Chrome using SoapUI

This error message…

java.lang.NoSuchMethodError: org.openqa.selenium.os.CommandLine.findExecutable(Ljava/lang/String;)Ljava/lang/String;
   java.lang.NoSuchMethodError: org.openqa.selenium.os.CommandLine.findExecutable(Ljava/lang/String;)Ljava/lang/String;

…implies that a NoSuchMethodError was raised when the os command findExecutable() tried to locate the executable as per your System.setProperty() line.

Class NoSuchMethodError

NoSuchMethodError extends IncompatibleClassChangeError and as per the Java Docs it is thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method. Normally, this error is caught by the compiler and this error can only occur at run time if the definition of a class has incompatibly changed. Incompatible class change occurs due to change in definition of some class, on which the currently executing method depends.

What went wrong?

You have created the WebDriver instance i.e. driver and casted it through ChromeDriver(). But the SoapUI/bin/ext sub-directory contains multiple defination from selenium-server-standalone-3.4.0.jar and selenium-chrome-driver-2.3.1.jar.

Solution

Perform the following steps :

  • Remove selenium-chrome-driver-2.3.1.jar from SoapUI/bin/ext sub-directory.
  • Upgrade JDK to recent levels JDK 8u171.
  • Upgrade Selenium to current levels Version 3.11.0.
  • Upgrade ChromeDriver to current ChromeDriver v2.38 level.
  • Keep Chrome version at Chrome v66.x levels. (as per ChromeDriver v2.38 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test.

Leave a Comment