JeyKey
JeyKey

Reputation: 423

Selenium Grid Extras 2.0.4 : org.openqa.selenium.WebDriverException: Error forwarding the new session

I tried to use Selenium Grid Extras from the page: https://github.com/groupon/Selenium-Grid-Extras

I managed to use it successfully on my private machine. I ran the command "java -jar Selenium-Grid-Extras-Jar.jar" and after configuration (https://ibb.co/j4wZPH), I was able to see the nodes by going to the address http://localhost:4444/grid/console:

enter image description here

Then I ran the tests via IntellIj and everything passed as expected: enter image description here

But when I try to do the same process on my corporate laptop, I get the error: enter image description here

I will attach full log of this error:

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$0(JsonWireProtocolResponse.java:53)
    at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
    at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123)
    at java.util.stream.ReferencePipeline$3$1.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$2.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$2.run(QueuedThreadPool.java:626)
    at java.lang.Thread.run(Unknown Source)

And when I go to: http://localhost:4444/grid/console - I see this: enter image description here

I tried to figure out why I get this error and found the answer (https://stackoverflow.com/a/42187314/7967616) that Selenium Grid doesn't have any node available with a browser that has the desired capabilities.

But during configuration I set the PORT 5555 for Selenium Grid Node and it works on my private laptop. I could not find the answer in the internet, so my hunch is that there is some problem with that PORT, but I don't know how I can check this.

Anyone had similar issues or problems or can help me with this issue? Will be grateful for any help.

EDITED

ChromeDriver version is 2.38 (latest)

Chrome Browser version is 66.0.3359.117 (actual)

I made sure that I have latest version of ChromeDriver and Browser.

Upvotes: 0

Views: 996

Answers (3)

JeyKey
JeyKey

Reputation: 423

My teammate helped me solve the problem. I had to unlock the ports in Windows Defender Firewall.

  • Go to Windows Defender Firewall (Open as admin)
  • Go to "Incoming rules"
  • In section "Actions" add new Rule -> select Port -> Select:
    1. Once - TCP
    2. Secondly - UDP
  • Provide ports (4444, 3000, 5555)
  • Enable connection

Repeat the proces but:

  • Go to "Leaving rules"
  • In section "Actions" add new Rule -> select Port -> Select:
    1. Once - TCP
    2. Secondly - UDP
  • Provide ports (4444, 3000, 5555)
  • Enable connection

Reboot the system and set up the Selenium Grid Extras again. It worked!

Upvotes: 0

vTad
vTad

Reputation: 349

Unlock selenium extras, hub and node ports in firewall and then it should work

Upvotes: 1

undetected Selenium
undetected Selenium

Reputation: 193088

This error message...

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

...implies that the ChromeDriver wasn't able to initiate an active connection with the WebClient i.e Chrome browser.

In absence of ChromeDriver and ChromeBrowser versioning information it seems to be version compatibility issue between the binaries you are using as follows :

  • Your chromedriver version is unknown to us.
  • Your chrome version is unknown to us.

Solution

  • Upgrade ChromeDriver to current ChromeDriver v2.38 level.
  • Keep Chrome version at Chrome v66.x levels. (as per ChromeDriver v2.38 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test.

Upvotes: 0

Related Questions