Java 在虚拟机上运行selenium网格时出现的问题

Java 在虚拟机上运行selenium网格时出现的问题,java,python,node.js,selenium,Java,Python,Node.js,Selenium,我正在用vagrant在虚拟机上尝试selenium网格。我所做的是按照这里的步骤,我定义了一个hubsudojava-jarselenium-server-standalone-2.41.0.jar-role hub 并在同一个VMsudojava-jarselenium-server-standalone-2.41.0.jar-role-node-hub上本地定义了节点http://10.0.2.2:4444/grid/register其中http://10.0.2.2:4444/是虚拟机的

我正在用vagrant在虚拟机上尝试selenium网格。我所做的是按照这里的步骤,我定义了一个hub
sudojava-jarselenium-server-standalone-2.41.0.jar-role hub

并在同一个VM
sudojava-jarselenium-server-standalone-2.41.0.jar-role-node-hub上本地定义了节点http://10.0.2.2:4444/grid/register
其中
http://10.0.2.2:4444/
是虚拟机的专用IP,用于向集线器注册节点

我的问题是,当我想运行python中的selenium测试时,会出现以下错误:

Exception: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 org.openqa.grid.common.exception.GridException: Error forwarding the new session The server returned an error : Failed to start new browser session: org.openqa.selenium.server.RemoteCommandException: Error while launching browser</title>
</head>
<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /selenium-server/driver/. Reason:
<pre>    org.openqa.grid.common.exception.GridException: Error forwarding the new session The server returned an error : Failed to start new browser session: org.openqa.selenium.server.RemoteCommandException: Error while launching browser</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
异常:
错误500 org.openqa.grid.common.exception.GridException:转发新会话时出错服务器返回错误:无法启动新浏览器会话:org.openqa.selenium.server.RemoteCommandException:启动浏览器时出错
HTTP错误:500
访问/selenium服务器/driver/时出现问题。原因:
org.openqa.grid.common.exception.GridException:转发新会话时出错服务器返回错误:无法启动新浏览器会话:org.openqa.selenium.server.RemoteCommandException:启动浏览器时出错


由码头提供动力://
当我在浏览器中运行它时,使用:
http://10.0.2.2:4444/selenium-服务器/驱动程序/?cmd=getNewBrowserSession&1=*firefox&2=http://www.google.com​

我收到此错误:
为安装功能转发新会话空VM池时出错

我认为该节点无法注册到集线器,我还将其更改为公共IP,因此我使用了类似
http://X.X.X.106:4444/grid/register
。但我仍然看到了错误。但是,当我在虚拟机之外尝试时,效果很好!!任何关于如何在虚拟机上修复selenium网格的想法。

我也尝试过这样做(网格+虚拟机),但没有成功。 问题在于主机和虚拟机之间的连接。 我认为您应该将VirtualBox上的网络连接配置为网桥: