RemoteWebDriver is not able to start a session using grid with 2.0rc3

120 views
Skip to first unread message

Mike

unread,
Jul 8, 2011, 6:54:37 PM7/8/11
to Selenium Users
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.

Krishnan Mahadevan

unread,
Jul 11, 2011, 1:56:18 AM7/11/11
to seleniu...@googlegroups.com
I am not sure, if this the right way of instantiating a RemoteWebDriver pointing it to a Grid2 hub.


wd = new RemoteWebDriver(new URL("http://localhost:4444/wd/ hub"), capability);

I tried using

RemoteWebDriver d = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);

and it always worked. I replace "localhost" with a remote machine to help switch my users from local to a remote execution environment and this is how I have been instantiating the RemoteWebDriver.


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"




--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


Mike

unread,
Jul 13, 2011, 5:17:32 PM7/13/11
to Selenium Users
I was able to get this working by using 127.0.0.1 instead of localhost
in my URL.

Thanks.

On Jul 10, 10:56 pm, Krishnan Mahadevan
<krishnan.mahadevan1...@gmail.com> wrote:
> I am not sure, if this the right way of instantiating a RemoteWebDriver
> pointing it to a Grid2 hub.
>
> wd = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),
> >  out : 30000, URL :http://10.0.2.154:4446/wd/hubtime out : 30000]
> > standalone-2.0rc2.jar -role rc -hubhttp://127.0.0.1:4444/grid/register
Reply all
Reply to author
Forward
0 new messages