Sorry in advance for the long post, but I wanted to provide all
possible info.
My guess is that I am doing this wrong, as it can't possibly be this
broken. I have found the line where the error occurs (which is
different from that being reported on the screen, so the sources don't
match the binaries), but it is not much help.
Here is what appears on the screen:
For the hub:
Jul 8, 2011 3:48:17 PM
org.openqa.grid.web.servlet.handler.WebDriverRequestHandler
forwardNewSessionRequest
WARNING: Error, header should contain Location
Jul 8, 2011 3:48:17 PM org.openqa.jetty.jetty.servlet.ServletHandler
handle
SEVERE: /wd/hub/session:
org.openqa.grid.internal.GridException: Error getting a new session
from the remote.[URL :
http://10.0.2.154:4445/selenium-server/driver
time
out : 30000, URL :
http://10.0.2.154:4446/wd/hub time out : 30000]
at
org.openqa.grid.web.servlet.handler.RequestHandler.handleNewSession(RequestHandler.java:
218)
at
org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:
143)
at
org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:
63)
at
org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:
53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
820)
at
org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:
428)
at
org.openqa.jetty.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:
473)
at
org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:
568)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:
1530)
at
org.openqa.jetty.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:
633)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:
1482)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:
909)
at
org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at
org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:
986)
at
org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at
org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:
243)
at
org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.openqa.jetty.util.ThreadPool
$PoolThread.run(ThreadPool.java:534)
For rc (why not webdriver?):
15:48:17.473 WARN - POST /selenium-server/driver/session HTTP/1.1
java.lang.NullPointerException: sessionId should not be null; has this
session been started yet?
at
org.openqa.selenium.server.FrameGroupCommandQueueSet.getQueueSet(FrameGroupCommandQueueSet.java:
215)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handleBrowserResponse(SeleniumDriverResourceHandler.java:
184)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:
148)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:
1530)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:
1482)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:
909)
at
org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at
org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:
986)
at
org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at
org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:
243)
at
org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.openqa.jetty.util.ThreadPool
$PoolThread.run(ThreadPool.java:534)
Here is my code in my test application that is trying to create the
remote session with some test lines commented out:
private final String[] BROWSERS =
{
"firefox",
"iexplore",
"chrome",
"html",
"opera"
};
/*
* RemoteWebDriver version
*
public DOTN_Helper(String browserName, String baseUrlString)
throws
Exception
{
WebDriver wd;
org.openqa.selenium.remote.DesiredCapabilities capability;
switch (parser.findString(browserName, BROWSERS))
{
case 0:
capability = DesiredCapabilities.firefox();
break;
case 1:
capability = DesiredCapabilities.internetExplorer();
break;
case 2:
capability = DesiredCapabilities.chrome();
break;
case 3:
capability = DesiredCapabilities.htmlUnit();
break;
case 4:
capability = DesiredCapabilities.opera();
break;
default:
throw new Exception("Unknown browser name for
RemoteWebDriver.");
} // switch
// capability.setJavascriptEnabled(true);
// capability.setPlatform(Platform.WINDOWS); // TODO: Allow for
platform to be configured later
// capability.setVersion(""); // TODO: Allow for version to be
configured later
wd = new RemoteWebDriver(new URL("
http://localhost:4444/wd/
hub"), capability);
useWebDriver(wd, baseUrlString);
} // DOTN_Helper
Just in case it is how I have set up the hub and servers here are
those command lines, all run on the same machine in separate command
line windows on WinXP:
java -jar C:\Selenium\selenium-2.0rc2\selenium-server-
standalone-2.0rc2.jar -role hub -nodeTimeout 600
java -jar C:\Selenium\selenium-2.0rc2\selenium-server-
standalone-2.0rc2.jar -role rc -hub
http://127.0.0.1:4444/grid/register
-port 4445 -browser browserName=firefox,maxInstances=1 -browser
browserName=iexplore,maxInstances=1 -browser
browserName=chrome,maxInstances=1
java -jar C:\Selenium\selenium-2.0rc2\selenium-server-
standalone-2.0rc2.jar -role webdriver -hub http://%HUB_IP%:%HUB_PORT%/grid/register
-port %PORT% -browser browserName=firefox,maxInstances=1 -browser
browserName=iexplore,maxInstances=1 -browser
browserName=chrome,maxInstances=1
Any and all suggestions as to how to get RemoteWebDriver working is
appreciated
Mike.