1

I am using eclipse 09-2019 with jdk13 and selenium 3.0.1 .jar file.

My Code is:

package package1;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Script1
{
      public static void main(String[] args)
      {
          System.out.println("Hii");
          System.setProperty("Webdriver.chrome.driver","E:\\Selenium\\chromedriver.exe");
          WebDriver driver=new ChromeDriver();
          driver.get("http://www.google.com");
      }
}

Error:

java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.bsf.BSFManager not in module
Naman
  • 27,789
  • 26
  • 218
  • 353
Akshay Kale
  • 53
  • 1
  • 5
  • This is not valid code, please fix it. – Guy Dec 04 '19 at 08:11
  • Does this answer your question? [Java 11 Unable to derive module descriptor](https://stackoverflow.com/questions/54682417/java-11-unable-to-derive-module-descriptor) – Naman Dec 07 '19 at 15:48

1 Answers1

2

InvalidModuleDescriptorException

InvalidModuleDescriptorException is thrown when reading a module descriptor and the module descriptor is found to be malformed or otherwise cannot be interpreted as a module descriptor.

InvalidModuleDescriptorException can be raised in either of the following scenarios:

  1. Issues with the Java project.
  2. Issues with the Java package with in a Java project.
  3. Issues with the Java class with in a Java package.

However, as per the discussion in Does Selenium v3.141 support Java 13? it seems the latest version of Selenium still doesn't supports .


Solution

The strategic solution will be to install the latest version of JDK 8u222 and execute the @Tests

Additionally, you also need to replace uppercap W with the lowercap w in the System.setProperty() line. So, effectively, you need to replace:

System.setProperty("Webdriver.chrome.driver","E:\\Selenium\\chromedriver.exe");

With

System.setProperty("webdriver.chrome.driver","E:\\Selenium\\chromedriver.exe");

Additional Consideration

Additionally, ensure that:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352