Selenium Grid Extras 2.0.4:org.openqa.selenium.WebDriverException:转发新会话时出错
Selenium Grid Extras 2.0.4 : org.openqa.selenium.WebDriverException: Error forwarding the new session
我尝试使用页面中的 Selenium Grid Extras:https://github.com/groupon/Selenium-Grid-Extras
我成功地在我的私人机器上使用了它。我 运行 命令 "java -jar Selenium-Grid-Extras-Jar.jar" 和配置后 (https://ibb.co/j4wZPH), I was able to see the nodes by going to the address http://localhost:4444/grid/console:
然后我 运行 通过 IntellIj 进行了测试,一切都按预期通过了:
但是当我尝试在我的公司笔记本电脑上执行相同的过程时,出现错误:
我将附上此错误的完整日志:
kwi 24, 2018 12:07:06 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to DesiredCapabilities.chrome()`
org.openqa.selenium.WebDriverException: Error forwarding the new session
Empty pool of VM for setup Capabilities {browserName: chrome, version: }
Command duration or timeout: 157 milliseconds
<4 internal calls>
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new[=11=](JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession[=11=](ProtocolHandshake.java:123)
at java.util.stream.ReferencePipeline.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:209)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:132)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:145)
at com.sii.BaseTest.RemoteWebdriverTestBaseDemoqa.setUp(RemoteWebdriverTestBaseDemoqa.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
at org.testng.TestRunner.beforeRun(TestRunner.java:626)
at org.testng.TestRunner.run(TestRunner.java:594)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
Caused by: org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities {browserName: chrome, version: }
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: 'BXKBFH2', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161'
Driver info: driver.version: unknown
at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:118)
at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:86)
at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:860)
at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.Server.handle(Server.java:530)
at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:347)
at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:256)
at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:102)
at org.seleniumhq.jetty9.io.ChannelEndPoint.run(ChannelEndPoint.java:124)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.seleniumhq.jetty9.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:626)
at java.lang.Thread.run(Unknown Source)
当我去:http://localhost:4444/grid/console - I see this:
我试图弄清楚为什么会出现此错误,并找到了答案 (),即 Selenium Grid 没有任何可用于具有所需功能的浏览器的节点。
但是在配置过程中,我为 Selenium Grid 节点设置了 PORT 5555,它可以在我的私人笔记本电脑上运行。我在网上找不到答案,所以我的直觉是那个端口有问题,但我不知道如何检查。
有没有人遇到过类似的问题或问题,或者可以帮助我解决这个问题?
将不胜感激。
已编辑
Chrome驱动版本为2.38(最新)
Chrome 浏览器版本为 66.0.3359.117(实际)
我确定我有最新版本的Chrome驱动程序和浏览器。
这个错误信息...
Caused by: org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities {browserName: chrome, version: }
...意味着 ChromeDriver 无法启动与 WebClient 的活动连接,即 Chrome 浏览器。
在缺少 ChromeDriver 和 ChromeBrowser 版本控制信息的情况下,它似乎是 版本兼容性 您使用的二进制文件之间的问题如下:
- 我们不知道您的chrome驱动程序版本。
- 我们不知道您的chrome版本。
解决方案
- 将Chrome驱动程序升级到当前ChromeDriver v2.38级别。
- 将 Chrome 版本保持在 Chrome v66.x 级别。 (as per ChromeDriver v2.38 release notes)
- 清理你的项目工作区通过你的IDE和重建你的项目只需要依赖。
- 使用 CCleaner 工具清除执行 测试套件 .
前后的所有 OS 琐事
- 如果您的基础 Web Client 版本太旧,则通过 Revo Uninstaller 卸载它并安装最新的 GA 和发布版本的 Web Client .
- 系统重启。
- 执行你的
@Test
.
在防火墙中解锁 selenium extras、集线器和节点端口,然后它应该可以工作
我的队友帮我解决了问题。我必须解锁 Windows Defender 防火墙中的端口。
- 转到 Windows Defender 防火墙(以管理员身份打开)
- 转到"Incoming rules"
- 在 "Actions" 部分添加新规则 -> select 端口 -> Select:
- 一次 - TCP
- 其次 - UDP
- 提供端口(4444、3000、5555)
- 启用连接
重复该过程但是:
- 转到"Leaving rules"
- 在 "Actions" 部分添加新规则 -> select 端口 -> Select:
- 一次 - TCP
- 其次 - UDP
- 提供端口(4444、3000、5555)
- 启用连接
重新启动系统并再次设置 Selenium Grid Extras。成功了!
我尝试使用页面中的 Selenium Grid Extras:https://github.com/groupon/Selenium-Grid-Extras
我成功地在我的私人机器上使用了它。我 运行 命令 "java -jar Selenium-Grid-Extras-Jar.jar" 和配置后 (https://ibb.co/j4wZPH), I was able to see the nodes by going to the address http://localhost:4444/grid/console:
然后我 运行 通过 IntellIj 进行了测试,一切都按预期通过了:
但是当我尝试在我的公司笔记本电脑上执行相同的过程时,出现错误:
我将附上此错误的完整日志:
kwi 24, 2018 12:07:06 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to DesiredCapabilities.chrome()`
org.openqa.selenium.WebDriverException: Error forwarding the new session
Empty pool of VM for setup Capabilities {browserName: chrome, version: }
Command duration or timeout: 157 milliseconds
<4 internal calls>
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new[=11=](JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession[=11=](ProtocolHandshake.java:123)
at java.util.stream.ReferencePipeline.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:209)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:132)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:145)
at com.sii.BaseTest.RemoteWebdriverTestBaseDemoqa.setUp(RemoteWebdriverTestBaseDemoqa.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
at org.testng.TestRunner.beforeRun(TestRunner.java:626)
at org.testng.TestRunner.run(TestRunner.java:594)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
Caused by: org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities {browserName: chrome, version: }
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: 'BXKBFH2', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161'
Driver info: driver.version: unknown
at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:118)
at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:86)
at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:860)
at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.Server.handle(Server.java:530)
at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:347)
at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:256)
at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:102)
at org.seleniumhq.jetty9.io.ChannelEndPoint.run(ChannelEndPoint.java:124)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.seleniumhq.jetty9.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:626)
at java.lang.Thread.run(Unknown Source)
当我去:http://localhost:4444/grid/console - I see this:
我试图弄清楚为什么会出现此错误,并找到了答案 (),即 Selenium Grid 没有任何可用于具有所需功能的浏览器的节点。
但是在配置过程中,我为 Selenium Grid 节点设置了 PORT 5555,它可以在我的私人笔记本电脑上运行。我在网上找不到答案,所以我的直觉是那个端口有问题,但我不知道如何检查。
有没有人遇到过类似的问题或问题,或者可以帮助我解决这个问题? 将不胜感激。
已编辑
Chrome驱动版本为2.38(最新)
Chrome 浏览器版本为 66.0.3359.117(实际)
我确定我有最新版本的Chrome驱动程序和浏览器。
这个错误信息...
Caused by: org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities {browserName: chrome, version: }
...意味着 ChromeDriver 无法启动与 WebClient 的活动连接,即 Chrome 浏览器。
在缺少 ChromeDriver 和 ChromeBrowser 版本控制信息的情况下,它似乎是 版本兼容性 您使用的二进制文件之间的问题如下:
- 我们不知道您的chrome驱动程序版本。
- 我们不知道您的chrome版本。
解决方案
- 将Chrome驱动程序升级到当前ChromeDriver v2.38级别。
- 将 Chrome 版本保持在 Chrome v66.x 级别。 (as per ChromeDriver v2.38 release notes)
- 清理你的项目工作区通过你的IDE和重建你的项目只需要依赖。
- 使用 CCleaner 工具清除执行 测试套件 . 前后的所有 OS 琐事
- 如果您的基础 Web Client 版本太旧,则通过 Revo Uninstaller 卸载它并安装最新的 GA 和发布版本的 Web Client .
- 系统重启。
- 执行你的
@Test
.
在防火墙中解锁 selenium extras、集线器和节点端口,然后它应该可以工作
我的队友帮我解决了问题。我必须解锁 Windows Defender 防火墙中的端口。
- 转到 Windows Defender 防火墙(以管理员身份打开)
- 转到"Incoming rules"
- 在 "Actions" 部分添加新规则 -> select 端口 -> Select:
- 一次 - TCP
- 其次 - UDP
- 提供端口(4444、3000、5555)
- 启用连接
重复该过程但是:
- 转到"Leaving rules"
- 在 "Actions" 部分添加新规则 -> select 端口 -> Select:
- 一次 - TCP
- 其次 - UDP
- 提供端口(4444、3000、5555)
- 启用连接
重新启动系统并再次设置 Selenium Grid Extras。成功了!