Desired capabilities ignored

186 views
Skip to first unread message

Ryan

unread,
Sep 29, 2011, 1:07:04 PM9/29/11
to Selenium Users
Hi,

I'm just getting started with Selenium Grid. I've used the following
commands to start up the hub and 1 remote control session:

> java -jar selenium-server-standalone-2.7.0.jar -role hub -port 80

> java -jar selenium-server-standalone-2.7.0.jar -role webdriver -hub http://localhost:80/grid/register -port 5555 -browser "browserName=internet explorer,version=8,platform=WINDOWS"

(I've also tried not specifying the -browser parameter and just
specifying -browserName="internet explorer")

..and the grid console shows that there is one IE node registered.

My test starts like this:
var hubUrl = Settings1.Default.hubUrl;

var dc = DesiredCapabilities.InternetExplorer();
driver = new RemoteWebDriver(new Uri(hubUrl), dc);

but I can never get the remote control to use IE. When Firefox was
installed it always used that - after I've now uninstalled it, I
receive the following exception:

SeleniumPlay.SeleniumTests (TestFixtureSetUp):
SetUp : System.InvalidOperationException : Cannot find firefox binary
in PATH. Make sure firefox is installed. OS appears to be: XP
Build info: version: '2.7.0', revision: '13926', time: '2011-09-23
13:24:59'
System info: os.name: 'Windows Server 2008', os.arch: 'x86',
os.version: '6.0', java.version: '1.7.0'
Driver info: driver.version: FirefoxDriver

The logs from the hub are:
Sep 29, 2011 5:58:31 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid server
Sep 29, 2011 5:58:32 PM org.openqa.jetty.http.HttpServer doStart
INFO: Version Jetty/5.1.x
Sep 29, 2011 5:58:32 PM org.openqa.jetty.util.FileResource <clinit>
INFO: Checking Resource aliases
Sep 29, 2011 5:58:33 PM org.openqa.jetty.util.Container start
INFO: Started
org.openqa.jetty.jetty.servlet.WebApplicationHandler@7fca02
Sep 29, 2011 5:58:33 PM org.openqa.jetty.util.Container start
INFO: Started WebApplicationContext[/,/]
Sep 29, 2011 5:58:33 PM org.openqa.jetty.http.SocketListener start
INFO: Started SocketListener on 0.0.0.0:80
Sep 29, 2011 5:58:33 PM org.openqa.jetty.util.Container start
INFO: Started org.openqa.jetty.jetty.Server@1390efd
Sep 29, 2011 5:58:35 PM org.openqa.grid.internal.RemoteProxy <init>
WARNING: Max instance not specified. Using default = 1 instance
Sep 29, 2011 5:58:38 PM
org.openqa.grid.web.servlet.handler.RequestHandler handleNewSession
WARNING: WARNING : using a beforeSession on a proxy that can support
multiple tests is risky.
Sep 29, 2011 5:58:39 PM
org.openqa.grid.web.servlet.handler.WebDriverRequestHandler
forwardNewSessionRequest
WARNING: Error, header should contain Location

..and from the RC:
Sep 29, 2011 5:58:34 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid node
adding browserName=internet explorer,version=8,platform=WINDOWS
17:58:34.869 INFO - Java: Oracle Corporation 21.0-b17
17:58:34.885 INFO - OS: Windows Server 2008 6.0 x86
17:58:34.885 INFO - v2.7.0, with Core v2.7.0. Built from revision
13926
17:58:35.025 INFO - RemoteWebDriver instances should connect to:
http://127.0.0.1:5555/wd/hub
17:58:35.025 INFO - Version Jetty/5.1.x
17:58:35.025 INFO - Started HttpContext[/selenium-server/driver,/
selenium-server/driver]
17:58:35.041 INFO - Started HttpContext[/selenium-server,/selenium-
server]
17:58:35.041 INFO - Started HttpContext[/,/]
17:58:35.041 INFO - Started
org.openqa.jetty.jetty.servlet.ServletHandler@1c6fed0
17:58:35.041 INFO - Started HttpContext[/wd,/wd]
17:58:35.041 INFO - Started SocketListener on 0.0.0.0:5555
17:58:35.041 INFO - Started org.openqa.jetty.jetty.Server@e00c09
17:58:35.041 INFO - using the json request :
{"class":"org.openqa.grid.common.RegistrationRequest","capabilities":
[{"platform":"WINDOWS","browserName":"internet
explorer","version":"8"}],"configuration":{"port":
5555,"register":true,"host":"10.224.69.103","proxy":"org.openqa.grid.selenium.proxy.WebDriverRemoteProxy","browser":"browserName=internet
explorer,version=8,platform=WINDOWS","maxSession":
5,"hubHost":"localhost","role":"webdriver","registerCycle":
5000,"hub":"http://localhost:80/grid/register","hubPort":
80,"url":"http://10.224.69.103:5555/wd/hub"}}
17:58:35.041 INFO - starting auto register thread. Will try to
register every 5000 ms.
17:58:35.056 INFO - Registering the node to hub :http://localhost:80/
grid/register
17:58:39.128 INFO - Executing: [new session: {platform=ANY,
browserName=internet explorer, version=}] at URL: /session)
17:58:39.175 WARN - Exception thrown
java.util.concurrent.ExecutionException:
org.openqa.selenium.WebDriverException:
java.lang.reflect.InvocationTargetException
Build info: version: '2.7.0', revision: '13926', time: '2011-09-23
13:24:59'
System info: os.name: 'Windows Server 2008', os.arch: 'x86',
os.version: '6.0',
java.version: '1.7.0'
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown
Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at
org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:
118)
at
org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:
89)
at
org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:
74)
at
org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:
87)
at
org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:
48)
at
org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:
166)
at
org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:
450)
at
org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:
432)
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.ServletHandler.dispatch(ServletHandler.java:
677)
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.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)
Caused by: org.openqa.selenium.WebDriverException:
java.lang.reflect.InvocationTargetException
Build info: version: '2.7.0', revision: '13926', time: '2011-09-23
13:24:59'
System info: os.name: 'Windows Server 2008', os.arch: 'x86',
os.version: '6.0',
java.version: '1.7.0'
Driver info: driver.version: unknown
at
org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:
98)
at
org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:
82)
at org.openqa.selenium.remote.server.DefaultSession
$BrowserCreator.call(DefaultSession.java:156)
at org.openqa.selenium.remote.server.DefaultSession
$BrowserCreator.call(DefaultSession.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown
Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
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.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:
88)
... 8 more
Caused by: org.openqa.selenium.WebDriverException: Cannot find firefox
binary in PATH. Make sure firefox is installed. OS appears to be: XP
Build info: version: '2.7.0', revision: '13926', time: '2011-09-23
13:24:59'
System info: os.name: 'Windows Server 2008', os.arch: 'x86',
os.version: '6.0',
java.version: '1.7.0'
Driver info: driver.version: FirefoxDriver
at
org.openqa.selenium.firefox.internal.Executable.<init>(Executable.java:
53)
at
org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:
60)
at
org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:
56)
at
org.openqa.selenium.firefox.FirefoxDriver.getBinary(FirefoxDriver.java:
124)
at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:
87)
... 13 more
17:58:39.191 WARN - Exception: Cannot find firefox binary in PATH.
Make sure firefox is installed. OS appears to be: XP
Build info: version: '2.7.0', revision: '13926', time: '2011-09-23
13:24:59'
System info: os.name: 'Windows Server 2008', os.arch: 'x86',
os.version: '6.0',
java.version: '1.7.0'
Driver info: driver.version: FirefoxDriver
17:58:40.267 INFO - Executing:
org.openqa.selenium.remote.server.handler.Status@2ed819 at URL: /
status)
17:58:40.267 INFO - Done: /status

What am I doing wrong?!

Thanks,
Ryan

François Reynaud

unread,
Sep 30, 2011, 3:56:11 AM9/30/11
to seleniu...@googlegroups.com
Hello,

it doesn't seem grid related.
Can you try using the same setup but target the node directly to confirm it :
 var dc = DesiredCapabilities.
InternetExplorer();
           driver = new RemoteWebDriver(new Uri("http://localhost:5555/wd/hub"), dc);

I think it will produce the same error indicating that webdriver cannot find IE.

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.


Ryan

unread,
Sep 30, 2011, 9:56:19 AM9/30/11
to Selenium Users
Hi François,

Thanks for the reply. Yes - it's exactly the same exception, so this
doesn't appear to be hub related.

SeleniumPlay.SeleniumTests (TestFixtureSetUp):
SetUp : System.InvalidOperationException : Cannot find firefox binary
in PATH. Make sure firefox is installed. OS appears to be: XP
Build info: version: '2.7.0', revision: '13926', time: '2011-09-23
13:24:59'
System info: os.name: 'Windows Server 2008', os.arch: 'x86',
os.version: '6.0', java.version: '1.7.0'
Driver info: driver.version: FirefoxDriver

Cheers,
Ryan

On Sep 30, 8:56 am, François Reynaud <francois.reyn...@gmail.com>
wrote:
> Hello,
>
> it doesn't seem grid related.
> Can you try using the same setup but target the node directly to confirm it
> :
>  var dc = DesiredCapabilities.
> InternetExplorer();
>            driver = new RemoteWebDriver(new Uri("http://localhost:5555/wd/hub"), dc);
>
> I think it will produce the same error indicating that webdriver cannot find
> IE.
>
> thanks,
> françois
>
>
>
>
>
>
>
> On Thu, Sep 29, 2011 at 6:07 PM, Ryan <ryan...@gmail.com> wrote:
> > Hi,
>
> > I'm just getting started with Selenium Grid.  I've used the following
> > commands to start up the hub and 1 remote control session:
>
> > > java -jar selenium-server-standalone-2.7.0.jar -role hub -port 80
>
> > > java -jar selenium-server-standalone-2.7.0.jar -role webdriver -hub
> >http://localhost:80/grid/register-port 5555 -browser
> > 5555,"register":true,"host":"10.224.69.103","proxy":"org.openqa.grid.seleni um.proxy.WebDriverRemoteProxy","browser":"browserName=internet
> ...
>
> read more »

Mike

unread,
Sep 30, 2011, 12:43:50 PM9/30/11
to Selenium Users
I would also try to output what the capability settings are.
The .toString() method does this for you. It helped me find a problem
in how I configured the capabilities for IE versus the other
browsers. Since it seems to be trying to bring up Firefox I have a
feeling the capabilities setting doesn't match what you have
configured, so to is trying to do a default browser, which in this
case is Firefox.

Mike
> > >http://localhost:80/grid/register-port5555 -browser
> > > Source)...
>
> read more »
Reply all
Reply to author
Forward
0 new messages