eclipse, Exception, Java, Selenium, Selenium Errors, Testing, Web Automation, Web Testing

Exception in thread “main” org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities [{browserName=safari}]


Exception in thread "main" org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities [{browserName=safari}]
Command duration or timeout: 198 milliseconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'ksehgal', ip: '', 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_67'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at org.openqa.selenium.remote.ErrorHandler.createThrowable(
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(
at org.openqa.selenium.remote.RemoteWebDriver.execute(
at org.openqa.selenium.remote.RemoteWebDriver.startSession(
at org.openqa.selenium.remote.RemoteWebDriver.<init>(
at org.openqa.selenium.remote.RemoteWebDriver.<init>(
at remoteDriver.TestFireFoxRemotely.main(

And some more stack trace

Caused by: org.openqa.grid.common.exception.GridException: Error forwarding the new session Empty pool of VM for setup Capabilities [{browserName=safari}]
at org.openqa.grid.web.servlet.handler.RequestHandler.process(
at org.openqa.grid.web.servlet.DriverServlet.process(
at org.openqa.grid.web.servlet.DriverServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.seleniumhq.jetty7.servlet.ServletHolder.handle(
at org.seleniumhq.jetty7.servlet.ServletHandler.doHandle(
at org.seleniumhq.jetty7.server.session.SessionHandler.doHandle(
at org.seleniumhq.jetty7.server.handler.ContextHandler.doHandle(
at org.seleniumhq.jetty7.servlet.ServletHandler.doScope(
at org.seleniumhq.jetty7.server.session.SessionHandler.doScope(
at org.seleniumhq.jetty7.server.handler.ContextHandler.doScope(
at org.seleniumhq.jetty7.server.handler.ScopedHandler.handle(
at org.seleniumhq.jetty7.server.handler.HandlerWrapper.handle(
at org.seleniumhq.jetty7.server.Server.handle(
at org.seleniumhq.jetty7.server.AbstractHttpConnection.handleRequest(
at org.seleniumhq.jetty7.server.BlockingHttpConnection.handleRequest(
at org.seleniumhq.jetty7.server.AbstractHttpConnection.content(
at org.seleniumhq.jetty7.server.AbstractHttpConnection$RequestHandler.content(
at org.seleniumhq.jetty7.http.HttpParser.parseNext(
at org.seleniumhq.jetty7.http.HttpParser.parseAvailable(
at org.seleniumhq.jetty7.server.BlockingHttpConnection.handle(
at org.seleniumhq.jetty7.util.thread.QueuedThreadPool.runJob(
at org.seleniumhq.jetty7.util.thread.QueuedThreadPool$

Code Snippet Used

public static void main(String [] args){
DesiredCapabilities capabilities = new DesiredCapabilities();
RemoteWebDriver remoteWD = null;
remoteWD = new RemoteWebDriver(new URL(""),capabilities);
}catch(MalformedURLException e){

How I stumble upon the above error

  • I started selenium server,both hub and node.
  1. java -jar selenium-server-standalone-2.41.0.jar -role hub -port 1111
  2. java -jar selenium-server-standalone-2.41.0.jar -role node -port 1111 -hub <hub-ip>:<hub-port>/grid/register
  • So now you have server and node in selenium grid set up which is running in default mode i.e. 5 browser instance of Chrome, 5 browser instance of FireFox, 1 browser instance of IE.
  • Now, try running the above code snippet, you will get the ERROR mentioned above.
  • Check the code carefully, we are trying to run your tests on ‘Safari’ browser. But we have not added the capability so that selenium can take care of it. Let us do it:
  • First execute this command from console prompt where your node is hosted.
java -jar selenium-server-standalone-2.42.2.jar -role node -hub http://<hub-ip>:<hub-port>/grid/register -port 5555 -browser browserName="<code>safari",</code>version=5,platform=WINDOWS",javascriptEnable=true"F:\SafariDriver.exe
  capabilities = new DesiredCapabilities();
 // Version of the browser
 // Platform test runner
  • And try running your tests again. This should fix the error which was coming earlier.

Root Cause Analysis

The problem was more of the browser. There could be possible below areas which has to be fixed to resolve the above issue:
1. Check if you have Safari browser at the server where you want to send your webdriver execution to. This could be your local machine or remote virtual box,etc
2. Check if you have possible drivers , required for execution.
3. Check if valid-compatible safari browser compatible jar of selenium stand alone jar at the desired machine.

For me its the first issue, at the remote machine safari browser was not there , I picked the latest safari browser along with the latest selenium standalone jar. And this worked for me.

If  you want your tests on any environment other than default then you need to make extra effort for doing so. And that extra stuff should be taken care before the actual execution.

Will share more about selenium grid in my coming blogs 🙂


1 thought on “Exception in thread “main” org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities [{browserName=safari}]”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s