facebook/php-webdriver — Issue #16: Selenium server returns 'bad request' when launching firefox
Author: rombert
Created: 2011-12-15 12:16:45+00:00
State: open

Hi,

I am unable to make php-webdriver work with the selenium server. I have minimal file which contains:

```session();
```

When launching, the PHP side errors out with

PHP Fatal error: Uncaught exception 'UnhandledWebDriverError' with message 'Bad request
Command duration or timeout: 224 milliseconds
Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 09:56:25'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.37.6-0.9-desktop', java.version: '1.6.0_29'
Driver info: driver.version: FirefoxDriver' in /home/robert/git-repos/php-webdriver/WebDriverBase.php:48
Stack trace:
#0 /home/robert/git-repos/php-webdriver/WebDriverBase.php(178): WebDriverBase::throwException(13, 'Bad request??Co...', Array)
#1 /home/robert/git-repos/php-webdriver/WebDriver.php(35): WebDriverBase->curl('POST', '/session', Array, Array)
#2 /home/robert/git-repos/php-webdriver/mantis_login.php(7): WebDriver->session()
#3 {main}
thrown in /home/robert/git-repos/php-webdriver/WebDriverBase.php on line 48

while in the selenium server console I get

Dec 15, 2011 2:13:45 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
14:13:45.837 INFO - Java: Sun Microsystems Inc. 20.4-b02
14:13:45.849 INFO - OS: Linux 2.6.37.6-0.9-desktop amd64
14:13:45.962 INFO - v2.15.0, with Core v2.15.0. Built from revision 15105
14:13:46.448 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
14:13:46.451 INFO - Version Jetty/5.1.x
14:13:46.470 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
14:13:46.471 INFO - Started HttpContext[/selenium-server,/selenium-server]
14:13:46.471 INFO - Started HttpContext[/,/]
14:13:46.622 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@30ec4a87
14:13:46.622 INFO - Started HttpContext[/wd,/wd]
14:13:46.626 INFO - Started SocketListener on 0.0.0.0:4444
14:13:46.626 INFO - Started org.openqa.jetty.jetty.Server@122ce908
14:13:59.203 INFO - Executing: [new session: {browserName=firefox}] at URL: /session)
14:14:03.651 INFO - Executing: [null, newSession {"desiredCapabilities":"Capabilities [{platform=ANY, browserName=firefox, version=}]"}]
14:14:03.838 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 09:56:25'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.37.6-0.9-desktop', java.version: '1.6.0_29'
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:139)
at org.openqa.selenium.remote.server.DefaultSession.(DefaultSession.java:108)
at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:86)
at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:87)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:49)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:196)
at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:586)
at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:523)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:490)
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.15.0', revision: '15105', time: '2011-12-08 09:56:25'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.37.6-0.9-desktop', java.version: '1.6.0_29'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:73)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:57)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:177)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.reflect.InvocationTargetException
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.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:63)
... 8 more
Caused by: org.openqa.selenium.UnsupportedCommandException: Bad request
Command duration or timeout: 186 milliseconds
Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 09:56:25'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.37.6-0.9-desktop', java.version: '1.6.0_29'
Driver info: driver.version: FirefoxDriver
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:147)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:113)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:424)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:123)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:78)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:137)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:87)
... 13 more
14:14:03.844 WARN - Exception: Bad request
Command duration or timeout: 186 milliseconds
Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 09:56:25'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.37.6-0.9-desktop', java.version: '1.6.0_29'
Driver info: driver.version: FirefoxDriver

Firefox is launched, but I can not interact with it.