【问题标题】:Getting "Chrome not reachable" error while executing test scripts in Selenium Grid With Chrome browser使用 Chrome 浏览器在 Selenium Grid 中执行测试脚本时出现“Chrome 无法访问”错误
【发布时间】:2019-04-17 14:09:08
【问题描述】:

我正在使用 chrome 浏览器在 selenium Grid 中运行自动化测试脚本,我收到 Chrome not reachable 错误。

 cucumber.runtime.CucumberException:
 org.openqa.selenium.WebDriverException: 
 chrome not reachable
      (Session info: chrome=68.0.3440.84)
      (Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 3.10.0-957.1.3.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)

【问题讨论】:

    标签: selenium selenium-webdriver selenium-grid


    【解决方案1】:

    我看到您的平台是 Linux。如果还没有完成,您能否将以下功能与您现有的功能一起添加并告诉我们。

    ChromeOptions cOptions = new ChromeOptions();
    //argument to switch off suid sandBox and no sandBox in Chrome 
    chrome_options.add_argument("--no-sandbox");
    chrome_options.add_argument("--disable-setuid-sandbox");
    

    【讨论】:

    • 感谢您的回复。我在我的应用程序中使用以下功能。 if (strBrowser.equals("grid")) { DesiredCapabilities cap = DesiredCapabilities.chrome(); tLog.logInfo("在 Selenium Grid 上调用 Chrome") cap.setCapability("platform", "LINUX"); cap.setCapability("版本","68.0.3440.84"); wdriver = new RemoteWebDriver(new URL("hub url"), cap); wdriver.get(strCapAppPathName); wdriver.manage().window().setSize(new Dimension(800, 600)); }
    • 您是否尝试将上述内容与您的一起添加
    • 你是否检查过 chrome 是否安装在 linux 上
    • 是的。它已安装
    猜你喜欢
    • 1970-01-01
    • 2021-12-31
    • 2021-02-11
    • 2017-08-31
    • 2019-02-24
    • 1970-01-01
    • 2019-03-14
    • 2014-12-27
    • 1970-01-01
    相关资源
    最近更新 更多