小编Ase*_*ell的帖子

JavaScript 错误:resource://gre/modules/XULStore.jsm,第 66 行:错误:使用 GeckoDriver Firefox 和 Selenium 找不到配置文件目录错误

即使我为 Gecko 驱动程序设置了正确的路径,我也遇到了错误。

主要的:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.Test;

public class firstCase {
    @Test
    static void titleControl(){
        System.setProperty("webdriver.gecko.driver", "D:\\Program Exe's\\geckodriver-v0.26.0-win64\\geckodriver.exe");          // Wee need that as Intellij doesn't know where it looks for browser
        WebDriver driver = new FirefoxDriver();
        driver.get("http://www.google.com");
        Assert.assertEquals(driver.getTitle(),"Google");
    }
}
Run Code Online (Sandbox Code Playgroud)

错误:

1594880236960   mozrunner::runner   INFO    Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\yasin\\AppData\\Local\\Temp\\rust_mozprofiledXH35Y"
JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
1594880239039   Marionette  INFO    Listening on port 49419
1594880239073   Marionette  WARN    TLS …
Run Code Online (Sandbox Code Playgroud)

java firefox selenium selenium-firefoxdriver geckodriver

4
推荐指数
1
解决办法
6572
查看次数