FAQ
Hello,

I have set up a hub using
java -jar selenium-server-standalone-2.23.1.jar -debug -role hub

and a node using:
java -jar selenium-server-standalone-2.23.1.jar -debug -role node -nodeConfig
node1.json

The node config file is the following:
{
"capabilities":
[
{
"platform":"VISTA",
"seleniumProtocol":"Selenium",
"browserName":"*firefox",
"maxInstances":5
},
{
"platform":"VISTA",
"seleniumProtocol":"Selenium",
"browserName":"*googlechrome",
"maxInstances":5
},
{
"platform":"VISTA",
"seleniumProtocol":"Selenium",
"browserName":"*iexplore",
"maxInstances":1
}
],
"configuration":
{
"port":5555,
"register":true,
"host":"localhost",
"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession":5,
"hubHost":"localhost",
"role":"node",
"registerCycle":5000,
"hub":"http://localhost:4444/grid/register",
"hubPort":4444,
"url":"http://localhost:5555",
"remoteHost":"http://localhost:5555"
}
}

For this, I have created the following, very simple test:
package test.test;

import java.net.URL;

import org.junit.Test;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

public class TestTest {

private WebDriver driver;

@Test
public void test() throws Exception {
DesiredCapabilities capabilities = new DesiredCapabilities(
"*googlechrome", "", Platform.ANY);// DesiredCapabilities.chrome();
driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub/"
), capabilities);
}
}

As far as I know, this should work, assuming the documentation and
tutorials on the internet are correct. However, I keep getting the
following error in my test:
org.openqa.selenium.WebDriverException:
Command duration or timeout: 761 milliseconds
Build info: version: '2.23.1', revision: 'unknown', time: '2012-06-22
10:28:20'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java
.version: '1.6.0_29'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.
java:188)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(
ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
454)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.
java:149)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
101)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
109)
at test.test.TestTest.test(TestTest.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(
ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod
.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.
java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
RemoteTestRunner.java:197)

and this in my node:
10:07:51.402 DEBUG - new HttpConnection: Socket[addr=
/127.0.0.1,port=64366,localport=5555]
10:07:51.509 DEBUG - REQUEST from SocketListener0@0.0.0.0:5555:
POST /selenium-server/driver/session HTTP/1.1
Host: localhost:4444
Accept: application/json, image/png
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Content-Length: 85

10:07:51.529 DEBUG - Try HttpContext[/selenium-server/driver,
/selenium-server/driver],0
10:07:51.531 DEBUG - Try HttpContext[/selenium-server,/selenium-server],0
10:07:51.535 DEBUG - RestishHandler org.openqa.jetty.http.handler.
SecurityHandler in HttpContext[/selenium-server,/selenium-server]
10:07:51.538 DEBUG - RestishHandler org.openqa.selenium.server.
StaticContentHandler in HttpContext[/selenium-server,/selenium-server]
10:07:51.549 INFO - Checking Resource aliases
10:07:51.552 DEBUG - PATH=/driver/session RESOURCE=file:/C:/Users/matthijsh/
Desktop/Selenium%20Grid/Grid/MISSING%20RESOURCE
10:07:51.555 DEBUG - Looking for file:/C:/Users/matthijsh/Desktop/Selenium%
20Grid/Grid/MISSING%20RESOURCE
10:07:51.561 DEBUG - RestishHandler org.openqa.selenium.server.
SessionExtensionJsHandler in HttpContext[/selenium-server,/selenium-server]
10:07:51.563 DEBUG - RestishHandler org.openqa.selenium.server.htmlrunner.
SingleTestSuiteResourceHandler in HttpContext[/selenium-server,/selenium-
server]
10:07:51.568 DEBUG - RestishHandler org.openqa.selenium.server.htmlrunner.
SeleniumHTMLRunnerResultsHandler@151ca803
10:07:51.570 DEBUG - RestishHandler org.openqa.selenium.server.
CachedContentTestHandler@353c375
10:07:51.576 DEBUG - RestishHandler org.openqa.selenium.server.
SeleniumDriverResourceHandler in HttpContext[/selenium-server,/selenium-
server]
10:07:51.580 DEBUG - req: POST /selenium-server/driver/session HTTP/1.1
Host: localhost:4444
Accept: application/json, image/png
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Content-Length: 85

10:07:51.601 WARN - POST /selenium-server/driver/session HTTP/1.1
java.lang.NullPointerException: sessionId should not be null; has thissession been started yet
?
at org.openqa.selenium.server.FrameGroupCommandQueueSet.getQueueSet(
FrameGroupCommandQueueSet.java:220)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.
handleBrowserResponse(SeleniumDriverResourceHandler.java:189)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(
SeleniumDriverResourceHandler.java:153)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:914)
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)
10:07:51.631 DEBUG - RESPONSE:
HTTP/1.1 500 Internal Server Error
Date: Tue, 26 Jun 2012 08:07:51 GMT
Server: Jetty/5.1.x (Windows 7/6.1 amd64 java/1.6.0_29
Connection: close

And this is the debug information the hub gives me:
26-jun-2012 10:16:43 org.apache.http.impl.conn.tsccm.
ThreadSafeClientConnManager closeIdleConnections
FINE: Closing connections idle longer than 100 MILLISECONDS
26-jun-2012 10:16:43 org.apache.http.impl.conn.tsccm.ConnPoolByRoutecloseIdleConnections
FINE: Closing connections idle longer than 100 MILLISECONDS
26-jun-2012 10:16:43 org.apache.http.impl.conn.tsccm.
ThreadSafeClientConnManager$1 getConnection
FINE: Get connection: HttpRoute[{}->http://localhost:5555], timeout = 120000
26-jun-2012 10:16:43 org.apache.http.impl.conn.tsccm.ConnPoolByRoutegetEntryBlocking
FINE: [HttpRoute[{}->http://localhost:5555]] total kept alive: 0, total
issued: 0, total allocated: 0 out of 2000
26-jun-2012 10:16:43 org.apache.http.impl.conn.tsccm.ConnPoolByRoutegetFreeEntry
FINE: No free connections [HttpRoute[{}->http://localhost:5555]][null]
26-jun-2012 10:16:43 org.apache.http.impl.conn.tsccm.ConnPoolByRoutegetEntryBlocking
FINE: Available capacity: 2000 out of 2000 [HttpRoute[{}->http:
//localhost:5555]][null]
26-jun-2012 10:16:43 org.apache.http.impl.conn.tsccm.ConnPoolByRoutecreateEntry
FINE: Creating new connection [HttpRoute[{}->http://localhost:5555]]
26-jun-2012 10:16:43 org.apache.http.impl.conn.
DefaultClientConnectionOperator openConnection
FINE: Connecting to localhost:5555
26-jun-2012 10:16:43 org.apache.http.client.protocol.RequestAddCookiesprocess
FINE: CookieSpec selected: best-match
26-jun-2012 10:16:43 org.apache.http.client.protocol.RequestAuthCacheprocess
FINE: Auth cache not set in the context
26-jun-2012 10:16:43 org.apache.http.impl.client.DefaultRequestDirectortryExecute
FINE: Attempt 1 to execute request
26-jun-2012 10:16:43 org.apache.http.impl.conn.DefaultClientConnectionsendRequestHeader
FINE: Sending request: POST /selenium-server/driver/session HTTP/1.1
26-jun-2012 10:16:43 org.apache.http.impl.conn.Wire wire
FINE: >> "POST /selenium-server/driver/session HTTP/1.1[\r][\n]"
26-jun-2012 10:16:43 org.apache.http.impl.conn.Wire wire
FINE: >> "Host: localhost:4444[\r][\n]"
26-jun-2012 10:16:43 org.apache.http.impl.conn.Wire wire
FINE: >> "Accept: application/json, image/png[\r][\n]"
26-jun-2012 10:16:43 org.apache.http.impl.conn.Wire wire
FINE: >> "Content-Type: application/json; charset=utf-8[\r][\n]"
26-jun-2012 10:16:43 org.apache.http.impl.conn.Wire wire
FINE: >> "Connection: keep-alive[\r][\n]"
26-jun-2012 10:16:43 org.apache.http.impl.conn.Wire wire
FINE: >> "Content-Length: 85[\r][\n]"
26-jun-2012 10:16:43 org.apache.http.impl.conn.Wire wire
FINE: >> "[\r][\n]"
26-jun-2012 10:16:43 org.apache.http.impl.conn.DefaultClientConnectionsendRequestHeader
FINE: >> POST /selenium-server/driver/session HTTP/1.1
26-jun-2012 10:16:43 org.apache.http.impl.conn.DefaultClientConnectionsendRequestHeader
FINE: >> Host: localhost:4444
26-jun-2012 10:16:43 org.apache.http.impl.conn.DefaultClientConnectionsendRequestHeader
FINE: >> Accept: application/json, image/png
26-jun-2012 10:16:43 org.apache.http.impl.conn.DefaultClientConnectionsendRequestHeader
FINE: >> Content-Type: application/json; charset=utf-8
26-jun-2012 10:16:44 org.apache.http.impl.conn.DefaultClientConnectionsendRequestHeader
FINE: >> Connection: keep-alive
26-jun-2012 10:16:44 org.apache.http.impl.conn.DefaultClientConnectionsendRequestHeader
FINE: >> Content-Length: 85
26-jun-2012 10:16:44 org.apache.http.impl.conn.Wire wire
FINE: >> "{"desiredCapabilities":{"platform":"ANY","browserName":"*
googlechrome","version":""}}"
26-jun-2012 10:16:44 org.apache.http.impl.conn.Wire wire
FINE: << "HTTP/1.1 500 Internal Server Error[\r][\n]"
26-jun-2012 10:16:44 org.apache.http.impl.conn.Wire wire
FINE: << "Date: Tue, 26 Jun 2012 08:16:44 GMT[\r][\n]"
26-jun-2012 10:16:44 org.apache.http.impl.conn.Wire wire
FINE: << "Server: Jetty/5.1.x (Windows 7/6.1 amd64 java/1.6.0_29[\r][\n]"
26-jun-2012 10:16:44 org.apache.http.impl.conn.Wire wire
FINE: << "Connection: close[\r][\n]"
26-jun-2012 10:16:44 org.apache.http.impl.conn.Wire wire
FINE: << "[\r][\n]"
26-jun-2012 10:16:44 org.apache.http.impl.conn.DefaultClientConnectionreceiveResponseHeader
FINE: Receiving response: HTTP/1.1 500 Internal Server Error
26-jun-2012 10:16:44 org.apache.http.impl.conn.DefaultClientConnectionreceiveResponseHeader
FINE: << HTTP/1.1 500 Internal Server Error
26-jun-2012 10:16:44 org.apache.http.impl.conn.DefaultClientConnectionreceiveResponseHeader
FINE: << Date: Tue, 26 Jun 2012 08:16:44 GMT
26-jun-2012 10:16:44 org.apache.http.impl.conn.DefaultClientConnectionreceiveResponseHeader
FINE: << Server: Jetty/5.1.x (Windows 7/6.1 amd64 java/1.6.0_29
26-jun-2012 10:16:44 org.apache.http.impl.conn.DefaultClientConnectionreceiveResponseHeader
FINE: << Connection: close
26-jun-2012 10:16:44 org.apache.http.impl.conn.DefaultClientConnectionshutdown
FINE: Connection shut down
26-jun-2012 10:16:44 org.apache.http.impl.conn.tsccm.
ThreadSafeClientConnManager releaseConnection
FINE: Released connection is not reusable.
26-jun-2012 10:16:44 org.apache.http.impl.conn.tsccm.ConnPoolByRoutefreeEntry
FINE: Releasing connection [HttpRoute[{}->http://localhost:5555]][null]
26-jun-2012 10:16:44 org.apache.http.impl.conn.tsccm.ConnPoolByRoutenotifyWaitingThread
FINE: Notifying no-one, there are no waiting threads

The Google Chrome driver (chromedriver.exe) is in the same folder I start
the hub and node from and the standalone is in, and also on my path. Its
log is empty. I get the same error with *firefox, *googlechrome, *iexplore
and practically every other way of telling it should use one of these
browsers I could think of. I have not tried any other browsers, but I doubt
they would work, since these three don't at this time, for me. :(

Does anyone have a clue why I am getting this error and/or what I am doing
wrong? If you need any other information, please tell me :)

Thank you very much,

Matt

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/ELRVq5PEEF8J.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedJun 26, '12 at 6:16p
activeJun 26, '12 at 6:16p
posts1
users1
websiteseleniumhq.org

1 user in discussion

Matthijs Hendriks: 1 post

People

Translate

site design / logo © 2022 Grokbase