【问题标题】:How can I run tests in Zalenium from Windows?如何从 Windows 中运行 Zalenium 测试?
【发布时间】:2019-07-19 14:53:25
【问题描述】:

我想在 Zalenium 上运行我的测试。我正在使用Win10 pro 64位。我开始 zalenium:

docker run --rm -ti --name zalenium -p 4444:4444 -v /var/run/docker.sock:/var/run/docker.sock -v /d/zalenium/videos:/home/seluser/videos --privileged dosel/zalenium start

通过代码设置我的驱动程序:

    public WebDriver createDriver() throws MalformedURLException {
    DesiredCapabilities cap = new DesiredCapabilities();

    if ("chrome".equals(browser.toLowerCase())){
        cap.setBrowserName(BrowserType.CHROME);
    }else if("firefox".equals(browser.toLowerCase())){
        cap.setBrowserName(BrowserType.FIREFOX);
    }
    return new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), cap);
}

但是,当我运行测试时,我得到了这个错误:

org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities {browserName: chrome}

我做错了什么?

【问题讨论】:

    标签: selenium docker selenium-grid zalenium


    【解决方案1】:

    我发现了问题。将 localhost 更改为您的 IP 地址有效。

    return new RemoteWebDriver(new URL("http://yourip:4444/wd/hub"), cap);
    

    【讨论】:

      猜你喜欢
      • 2012-01-08
      • 2020-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-18
      • 1970-01-01
      相关资源
      最近更新 更多