UnreachableBrowserException:无法开始新的会话.可能的原因是带有Selenium Grid的远程服务器的地址无效 [英] UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server with Selenium Grid

查看:905
本文介绍了UnreachableBrowserException:无法开始新的会话.可能的原因是带有Selenium Grid的远程服务器的地址无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

打开新的驱动程序窗口时出现错误:

Error in opening new driver window:

org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

服务器日志:

Forwarding newSession on session null to remote

我正在linux上运行以下代码:

I am running following code on linux:

driver= new RemoteWebDriver((new URL( "http://"+ip+":5555/wd/hub")), capability);

我的中心节点已启动并正在运行.那为什么我会收到这个错误.

My hub-node already up and running. Then why i am getting this error.

推荐答案

此错误消息...

org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

和服务器日志...

Forwarding newSession on session null to remote

...表示 Selenium Grid Hub / Selenium Grid Node 没有正确启动/启动.结果,null session被转发到 RemoteWebDriver .

...implies that the Selenium Grid Hub / Selenium Grid Node wasn't properly initiated/started. As a result a null session was forwarded to the RemoteWebDriver.

有关您在 Selenium 服务器/客户端, WebDriver 变体/version和 WebBrowser 中使用的二进制文件版本的更多信息变体/version以及用于启动 Selenium Grid Hub / Selenium Grid Node 的命令将帮助我们以一种更简单的方式调试问题.

Some more information regarding the versions of the binaries which you have used interms of Selenium server/client, WebDriver variant /version and WebBrowser variant /version and the commands you have used to initiate the Selenium Grid Hub / Selenium Grid Node would have helped us to debug your issue in a easier way.

但是,由于以下多种因素,可能会发生此问题:

However this issue can happen due to multiple factors as follows:

  • 您正在使用 uri 5555/wd/hub,因此请确保在端口 5555 上启动了 Selenium Grid Hub .
  • 您可以选择将capability参数替换为Options类的实例,如下所示:

  • You are using the uri 5555/wd/hub, so ensure that Selenium Grid Hub is initiated on port 5555.
  • You may opt to replace the capability argument with an instance of Options class as follows:

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("browser", "chrome");
//seting the required capabilities
ChromeOptions options = new ChromeOptions();
options.merge(caps);
WebDriver driver = new RemoteWebDriver((new URL( "http://"+ip+":5555/wd/hub")), options);        

  • 您可以在

    这篇关于UnreachableBrowserException:无法开始新的会话.可能的原因是带有Selenium Grid的远程服务器的地址无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆