“"java.lang.module.InvalidModuleDescriptorException:提供程序类org.apache.bsf.BSFManager不在模块中"ChromeDriver Selenium错误 [英] "java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.bsf.BSFManager not in module" error with ChromeDriver Selenium

查看:327
本文介绍了“"java.lang.module.InvalidModuleDescriptorException:提供程序类org.apache.bsf.BSFManager不在模块中"ChromeDriver Selenium错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将eclipse 09-2019与jdk13和selenium 3.0.1 .jar文件一起使用.

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

我的代码是:

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");
      }
}

错误:

java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.bsf.BSFManager not in module

推荐答案

InvalidModuleDescriptorException

InvalidModuleDescriptorException 被抛出读取模块描述符时发现模块描述符格式错误或无法解释为模块描述符.

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 :

  1. 有关Java项目的问题.
  2. 与Java项目中的Java软件包一起发布.
  3. 与Java类一起发布在Java包中.

但是,根据 Does Selenium v​​3中的讨论.141是否支持Java 13?似乎是仍然不支持.

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

战略解决方案是安装最新版本的 JDK 8u222 并执行 @Tests

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

此外,您还需要在 System.setProperty()行中,将大写字母 W 替换为小写字母 w .因此,有效地,您需要替换:

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");

使用

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


其他注意事项

另外,请确保:

  • Selenium is upgraded to current levels Version 3.141.59.
  • ChromeDriver is updated to current ChromeDriver v79.0.3945.36 level.
  • Chrome is updated to current Chrome Version 79.0 level. (as per ChromeDriver v79.0 release notes)

这篇关于“"java.lang.module.InvalidModuleDescriptorException:提供程序类org.apache.bsf.BSFManager不在模块中"ChromeDriver Selenium错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆