【问题标题】:Selenium script Error showing during initialization of boot layer [duplicate]引导层初始化期间显示 Selenium 脚本错误 [重复]
【发布时间】:2019-02-24 07:31:43
【问题描述】:

我是硒的新手。使用 eclipse 运行我的第一个测试用例,但在运行代码时出现以下错误。

 Error occurred during initialization of boot layer
    java.lang.module.FindException: Unable to derive module descriptor for C:\selenium-server-standalone-3.9.0.jar
    Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.bsf.BSFManager not in module

我在我的项目中导入了 selenium-server-3.9.0、selenium-server-standalone-3.9.0 和 bsf-2.4.0 jar 文件。

这是我在 eclipse 上运行的代码:

package Automation;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Testing {
    public static void main(String[] args) {

        System.setProperty("webdriver.chrome.driver", "C:\\chromedriver_win32.exe");

        WebDriver driver = new ChromeDriver();
        driver.get("http://www.gmail.com");
        driver.manage().window().maximize();
        driver.manage().deleteAllCookies();
        driver.findElement(By.id("identifierId")).sendKeys("guptasakshi34@gmail.com");
        driver.findElement(By.className("RveJvd snByac")).click();
        String at = driver.getTitle();
        String et = "gmail";
        driver.close();
        if(at.equalsIgnoreCase(et))
        {
            System.out.println("Test Successful");

        }
        else
        {
            System.out.println("Test Failue");
        }

    }

}

【问题讨论】:

  • 需要更多信息。
  • 我添加了正确的代码信息。你能调查一下并告诉我解决方案吗

标签: java selenium


【解决方案1】:

我认为问题可能是您同时导入了 Selenium 服务器和独立服务器。您需要选择其中一个(我更喜欢独立服务器,因为 Selenium 服务器要求您记住这样做

webdriver-manager start

和相关命令。独立服务器只需在您的exports.config 文件中指定,您无需担心。

【讨论】:

    猜你喜欢
    • 2021-03-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-17
    • 2021-09-21
    • 1970-01-01
    • 2019-02-24
    • 1970-01-01
    相关资源
    最近更新 更多