Grid 2, RemoteWebDriver "sessionId should not be null" exception

693 views
Skip to first unread message

Renan Michaud

unread,
Sep 14, 2011, 8:25:35 AM9/14/11
to Selenium Users
Hello,

In order to use Selenium Webdriver instead of Selenium RC, i try to
use it with a grid a some nodes.

I run a Selenium Grid with the below command:

java -jar selenium-server-standalone-2.5.0.jar -role hub

On a VM i run a node with:

java -jar selenium-server-standalone-2.5.0.jar -role webdriver -hub
http://gridname:4444/grid/register -port 5557 -browser
browserName=firefox -url http://ip:5557/selenium-server/driver

On a third hand i have a test case using RemoteWebDriver, instantiated
by:

RemoteWebDriver driver = new RemoteWebDriver(new URL("http://gridname:
4444/wd/hub"), DesiredCapabilities.firefox());

This code just throw the below Exception:

Exception in thread "main" org.openqa.selenium.WebDriverException:
Build info: version: '2.5.0', revision: '13516', time: '2011-08-23
18:29:57'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
java.version: '1.6.0_24'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:
131)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:
105)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
409)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:
108)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
86)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
94)
at
ibp.ate.satelite.selenium.RemoteWebDriverFactory.getFirefoxDriver(RemoteWebDriverFactory.java:
34)

The output server side is:

14 sept. 2011 13:58:35
org.openqa.grid.web.servlet.handler.RequestHandler handle NewSession
ATTENTION: WARNING : using a beforeSession on a proxy that can support
multiple tests is risky.
14 sept. 2011 13:58:39
org.openqa.grid.web.servlet.handler.WebDriverRequestHandler
forwardNewSessionRequest
ATTENTION: Error, header should contain Location

And node side :

15:02:46.105 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:
216)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handleBrowserResponse(SeleniumDriverResourceHandler.java:
187)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:
151)
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)

From various thread on this group and from the selenium googlecode
project's wiki, i thought that was the way to use RemoteWebdriver, but
obviously it's not... If someone could help please!

François Reynaud

unread,
Sep 14, 2011, 10:33:02 AM9/14/11
to seleniu...@googlegroups.com
hi,

what happens if you target the node directly ?
RemoteWebDriver driver = new RemoteWebDriver(new URL("http://node:5557/wd/hub), DesiredCapabilities.firefox()

thanks,
françois



--
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.


Luke Inman-Semerau

unread,
Sep 14, 2011, 10:45:26 AM9/14/11
to seleniu...@googlegroups.com
I think he just needs to remove the "-url" command line option when starting the remote server. 

-Luke

Renan Michaud

unread,
Sep 14, 2011, 10:56:29 AM9/14/11
to Selenium Users
If i target the node directly it works.

So the mistake was on the command line used to start the nodes:
java -jar selenium-server-standalone-2.5.0.jar -role webdriver -hub
http://gridname:4444/grid/register -port 5557 -browser
browserName=firefox -url http://ip:5557/selenium-server/driver

the url parameter was set for Selenium RC version i guess. If i
replace by http://ip:5557/wd/hub, it works fine.

Thank you very much.


On 14 sep, 16:33, François Reynaud <francois.reyn...@gmail.com> wrote:
> hi,
>
> what happens if you target the node directly ?
> RemoteWebDriver driver = new RemoteWebDriver(new URL("http://node:5557/wd/hub), DesiredCapabilities.firefox()
>
> thanks,
> françois
>
>
>
> On Wed, Sep 14, 2011 at 1:25 PM, Renan Michaud <renan.mich...@gmail.com>wrote:
>
>
>
> > Hello,
>
> > In order to use Selenium Webdriver instead of Selenium RC, i try to
> > use it with a grid a some nodes.
>
> > I run a Selenium Grid with the below command:
>
> > java -jar selenium-server-standalone-2.5.0.jar -role hub
>
> > On a VM i run a node with:
>
> > java -jar selenium-server-standalone-2.5.0.jar -role webdriver -hub
> >http://gridname:4444/grid/register-port 5557 -browser
> > browserName=firefox -urlhttp://ip:5557/selenium-server/driver
>
> > On a third hand i have a test case using RemoteWebDriver, instantiated
> > by:
>
> > RemoteWebDriver driver = new RemoteWebDriver(new URL("http://gridname:
> > 4444/wd/hub"), DesiredCapabilities.firefox());
>
> > This code just throw the below Exception:
>
> > Exception in thread "main" org.openqa.selenium.WebDriverException:
> > Build info: version: '2.5.0', revision: '13516', time: '2011-08-23
> > 18:29:57'
> > System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
> > java.version: '1.6.0_24'
> > Driver info: driver.version: RemoteWebDriver
> >        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > Method)
> >        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
> > Source)
> >        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> > Source)
> >        at java.lang.reflect.Constructor.newInstance(Unknown Source)
> >        at
> > org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:
> > 131)
> >        at
>
> > org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.­java:
> > 105)
> >        at
> > org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
> > 409)
> >        at
>
> > org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.jav­a:
> > 108)
> >        at
> > org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
> > 86)
> >        at
> > org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
> > 94)
> >        at
>
> > ibp.ate.satelite.selenium.RemoteWebDriverFactory.getFirefoxDriver(RemoteWeb­DriverFactory.java:
> > 34)
>
> > The output server side is:
>
> > 14 sept. 2011 13:58:35
> > org.openqa.grid.web.servlet.handler.RequestHandler handle NewSession
> > ATTENTION: WARNING : using a beforeSession on a proxy that can support
> > multiple tests is risky.
> > 14 sept. 2011 13:58:39
> > org.openqa.grid.web.servlet.handler.WebDriverRequestHandler
> > forwardNewSessionRequest
> > ATTENTION: Error, header should contain Location
>
> > And node side :
>
> > 15:02:46.105 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(FrameGroup­CommandQueueSet.java:
> > 216)
> >        at
>
> > org.openqa.selenium.server.SeleniumDriverResourceHandler.handleBrowserRespo­nse(SeleniumDriverResourceHandler.java:
> > 187)
> >        at
>
> > org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDri­verResourceHandler.java:
> >http://groups.google.com/group/selenium-users?hl=en.- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -

François Reynaud

unread,
Sep 14, 2011, 11:06:00 AM9/14/11
to seleniu...@googlegroups.com
you shouldn't need the -url param at all actually.
Do you have issues if you remove it completly ?

Renan Michaud

unread,
Sep 15, 2011, 4:36:21 AM9/15/11
to Selenium Users
My nodes and the grid are not on the same network. The ip specified in
the url parameter is the gateway's one. The port specified is a NATed
one.
So i thought that i should use this parameter...

We plan to change this and have the grid and nodes on the same network
and then remove this parameter.

On 14 sep, 17:06, François Reynaud <francois.reyn...@gmail.com> wrote:
> you shouldn't need the -url param at all actually.
> Do you have issues if you remove it completly ?
>
> On Wed, Sep 14, 2011 at 3:56 PM, Renan Michaud <renan.mich...@gmail.com>wrote:
>
>
>
> > If i target the node directly it works.
>
> > So the mistake was on the command line used to start the nodes:
> > java -jar selenium-server-standalone-2.5.0.jar -role webdriver -hub
> >http://gridname:4444/grid/register-port 5557 -browser
> > browserName=firefox -urlhttp://ip:5557/selenium-server/driver
>
> > the url parameter was set for Selenium RC version i guess. If i
> > replace byhttp://ip:5557/wd/hub, it works fine.
>
> > Thank you very much.
>
> > On 14 sep, 16:33, François Reynaud <francois.reyn...@gmail.com> wrote:
> > > hi,
>
> > > what happens if you target the node directly ?
> > > RemoteWebDriver driver = new RemoteWebDriver(new URL("
> >http://node:5557/wd/hub), DesiredCapabilities.firefox()
>
> > > thanks,
> > > françois
>
> > > On Wed, Sep 14, 2011 at 1:25 PM, Renan Michaud <renan.mich...@gmail.com
> > >wrote:
>
> > > > Hello,
>
> > > > In order to use Selenium Webdriver instead of Selenium RC, i try to
> > > > use it with a grid a some nodes.
>
> > > > I run a Selenium Grid with the below command:
>
> > > > java -jar selenium-server-standalone-2.5.0.jar -role hub
>
> > > > On a VM i run a node with:
>
> > > > java -jar selenium-server-standalone-2.5.0.jar -role webdriver -hub
> > > >http://gridname:4444/grid/register-port5557 -browser
> > > >http://groups.google.com/group/selenium-users?hl=en.-Masquer le texte
Reply all
Reply to author
Forward
0 new messages