我正在使用带有 jdk13 和 selenium 3.0.1 .jar 文件的 eclipse 09-2019.
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 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 可以在以下任一情况下引发:
InvalidModuleDescriptorException can be raised in either of the following scenarios:
但是,根据 Does Selenium v3.141 支持 Java 13? 似乎是 Selenium 仍然不支持 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");
<小时>
此外,请确保:
这篇关于“java.lang.module.InvalidModuleDescriptorException:提供程序类 org.apache.bsf.BSFManager 不在模块中"ChromeDriver Selenium 出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何检测 32 位 int 上的整数溢出?How can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
return 语句之前的局部变量,这有关系吗?Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
如何将整数转换为整数?How to convert Integer to int?(如何将整数转换为整数?)
如何在给定范围内创建一个随机打乱数字的 intHow do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
java的行为不一致==Inconsistent behavior on java#39;s ==(java的行为不一致==)
为什么 Java 能够将 0xff000000 存储为 int?Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)