0

Using selenium-server-standalone-2.18.0.jar. Running the hub and node in the same host. Running the the client code on a separate host

In the hub console, I am able to see that one of the nodes has connected with 5 firefox icons. When I run my client code, I see that one of the firefox icons is taken away as if the hub has given the request to the connected node. I see no errors in the hub logs. I am launching the browser using ruby + watir-webdriver like so:

capabilities = WebDriver::Remote::Capabilities.firefox
b=Watir::Browser.new(:remote, :url => "http://[remote-host]:4444/wd/hub", :desired_capabilities => capabilities)

And the error I am receiving:

from (irb):52>> b=Watir::Browser.new(:remote, :url => "http://[remote-host]:4444/wd/hub", :desired_capabilities => capabilities)
Selenium::WebDriver::Error::UnknownError: Error forwarding the new session new session request for webdriver should contain a location header with the session. (org.openqa.grid.common.exception.GridException)
from [remote server] org.openqa.grid.web.servlet.handler.RequestHandler(RequestHandler.java):151:in `process'
from [remote server] org.openqa.grid.web.servlet.DriverServlet(DriverServlet.java):81:in `process' from [remote server] org.openqa.grid.web.servlet.DriverServlet(DriverServlet.java):67:in `doPost'
from [remote server] javax.servlet.http.HttpServlet(HttpServlet.java):727:in `service'
from [remote server] javax.servlet.http.HttpServlet(HttpServlet.java):820:in `service'
from [remote server] org.openqa.jetty.jetty.servlet.ServletHolder(ServletHolder.java):428:in `handle'from [remote server] org.openqa.jetty.jetty.servlet.WebApplicationHandler(WebApplicationHandler.java):473:in `dispatch' from [remote server] org.openqa.jetty.jetty.servlet.ServletHandler(ServletHandler.java):568:in \`handle'
from [remote server] org.openqa.jetty.http.HttpContext(HttpContext.java):1530:in `handle'
from [remote server] org.openqa.jetty.jetty.servlet.WebApplicationContext(WebApplicationContext.java):633:in `handle' from [remote server] org.openqa.jetty.http.HttpContext(HttpContext.java):1482:in `handle'
...
Željko Filipin
  • 56,372
  • 28
  • 94
  • 125
laluser
  • 149
  • 2
  • 9

2 Answers2

0

Selenium Grid had a lot of issues fixed as of 2.21.0. You should try running with a newer JAR.

nirvdrum
  • 2,319
  • 17
  • 26
0

Hi did you get this resolved? I know it's been half a year since you posted, but I thought perhaps the problem was in regards to your variable for capabilities...

Here's how I got it to work - keep in mind that I'm using Cucumber with Watir-webdriver and Selenium Grid2:

In my case I use an env.rb variable called browser_name. It's set like this:

def browser_name
  (ENV['BROWSER'] ||= 'firefox').downcase.to_sym
end

Then in the env.rb file

Before do
    @browser = Watir::Browser.new(:remote, :url=>"http://[mygridhubhost]:4444/wd/hub", :desired_capabilities=> browser_name)

So kicking off the test, before it is run it sets up with the grid with the browser_name, in this case it defaults to firefox....

Anyway, it works for me. I'm also using Selenium Grid 2 version 2.31

continuousqa
  • 508
  • 4
  • 14