Kzqai
Kzqai

Reputation: 23062

Selenium creates blank firefox browser window, which then does nothing instead of running selenium browser tests

I'm getting problems where I can't get firefox to sync up with selenium when running automated tests. When I run the selenium server & the firefox phpunit tests, firefox continually times out (apparently) as it's unable to connect on the appropriate port. When I connect myself, I get some kind of jetty 403 error "forbidden for proxy", but I don't really know what to do to correct the issue.

How do I debug this to determine where the problem lies?

More detail on the logs and the error messages below:

I start the selenium server:

java -jar selenium-server-standalone-2.42.2.jar 
Oct 20, 2014 2:44:09 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
14:44:09.957 INFO - Java: Oracle Corporation 25.25-b02
14:44:09.957 INFO - OS: Linux 3.2.0-70-generic amd64
14:44:09.964 INFO - v2.42.2, with Core v2.42.2. Built from revision 6a6995d
14:44:10.048 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match with current platform: LINUX
14:44:10.086 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
14:44:10.088 INFO - Version Jetty/5.1.x
14:44:10.089 INFO - Started HttpContext[/selenium-server,/selenium-server]
14:44:10.111 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@725bef66
14:44:10.111 INFO - Started HttpContext[/wd,/wd]
14:44:10.111 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
14:44:10.111 INFO - Started HttpContext[/,/]
14:44:10.115 INFO - Started SocketListener on 0.0.0.0:4444
14:44:10.115 INFO - Started org.openqa.jetty.jetty.Server@30dae81

Then I run the functional selenium tests for firefox as the www-data user:

sudo -u www-data ../../vendor/bin/phpunit -c refox.xml functional
PHPUnit 3.7.37 by Sebastian Bergmann.

Configuration read from /srv/xxx/protected/tests/firefox.xml

PHP Notice:  Undefined offset: 1 in /srv/xxx/protected/extensions/webdriver-bindings/phpwebdriver/WebDriver.php on line 58
FCurrent URL: (Unknown)
Current Title: (Unknown)
Screenshot file: /srv/xxx/protected/tests/output/test.failed.1413831941.6997.png

Now, from what I can tell, the pertinent error from selenium is:

15:40:30.768 WARN - Exception: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
@googlecode.com visible
1413833983888   DeferredSave.extensions.json    DEBUG   Save changes
1413833983889   DeferredSave.extensions.json    DEBUG   Save changes
1413833983889   addons.xpi  DEBUG   New add-on [email protected] installed in app-global
1413833983896   addons.xpi-utils    DEBUG   Make addon app-global:[email protected] visible
1413833983896   DeferredSave.extensions.json    DEBUG   Save changes
1413833983896   DeferredSave.extensions.json    DEBUG   Save changes
1413833983898   addons.xpi  DEBUG   New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
1413833983900   addons.xpi-utils    DEBUG   Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} visible
1413833983900   DeferredSave.extensions.json    DEBUG   Save changes
1413833983900   DeferredSave.extensions.json    DEBUG   Save changes
1413833983900   addons.xpi  DEBUG   New add-on [email protected] installed in app-global
1413833983906   addons.xpi-utils    DEBUG   Make addon app-global:[email protected] visible
1413833983906   DeferredSave.extensions.json    DEBUG   Save changes
1413833983906   DeferredSave.extensions.json    DEBUG   Save changes
1413833983907   addons.xpi  DEBUG   New add-on [email protected] installed in app-system-share
1413833983910   addons.xpi-utils    DEBUG   Make addon app-system-share:[email protected] visible
1413833983910   DeferredSave.extensions.json    DEBUG   Save changes
1413833983910   DeferredSave.extensions.json    DEBUG   Save changes
1413833983915   addons.xpi  DEBUG   Updating database with changes to installed add-ons
1413833983915   addons.xpi-utils    DEBUG   Updating add-on states
1413833983916   addons.xpi-utils    DEBUG   Writing add-ons list
1413833983917   addons.xpi  DEBUG   Registering manifest for /usr/lib/firefox/browser/extensions/[email protected]
1413833983918   addons.xpi  DEBUG   Registering manifest for /usr/lib/firefox/browser/extensions/[email protected]
1413833984887   DeferredSave.extensions.json    DEBUG   Starting timer
1413833984920   addons.manager  DEBUG   shutdown
1413833984921   DeferredSave.extensions.json    DEBUG   Starting write
1413833984922   addons.xpi  DEBUG   shutdown
1413833984922   addons.xpi-utils    DEBUG   shutdown
1413833984986   DeferredSave.extensions.json    DEBUG   Write succeeded
1413833984986   addons.xpi-utils    DEBUG   XPI Database saved, setting schema version preference to 16
1413833984986   addons.xpi  DEBUG   Notifying XPI shutdown observers
1413833984990   addons.manager  DEBUG   Async provider shutdown done
1413833985681   addons.manager  DEBUG   Loaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]
1413833985682   addons.manager  DEBUG   Loaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]
1413833985685   addons.xpi  DEBUG   startup
1413833985686   addons.xpi  INFO    Mapping [email protected] to /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/[email protected]
1413833985686   addons.xpi  INFO    Mapping [email protected] to /usr/lib/firefox/browser/extensions/[email protected]
1413833985686   addons.xpi  INFO    Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to /usr/lib/firefox/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
1413833985687   addons.xpi  INFO    Mapping [email protected] to /usr/lib/firefox/browser/extensions/[email protected]
1413833985687   addons.xpi  DEBUG   Ignoring file entry whose name is not a valid add-on ID: /tmp/anonymous6261528948184700600webdriver-profile/extensions/webdriver-staging
1413833985687   addons.xpi  INFO    Mapping [email protected] to /tmp/anonymous6261528948184700600webdriver-profile/extensions/[email protected]
1413833985688   addons.xpi  DEBUG   checkForChanges
1413833985692   addons.xpi  DEBUG   No changes found
1413833985695   addons.xpi  DEBUG   Registering manifest for /usr/lib/firefox/browser/extensions/[email protected]
1413833985696   addons.xpi  DEBUG   Registering manifest for /usr/lib/firefox/browser/extensions/[email protected]
*** Blocklist::_preloadBlocklistFile: blocklist is disabled

15:41:08.028 INFO - Executing: [new session: Capabilities [{nativeEvents=false, name=AmericaTest-firefox, browserName=firefox, javascriptEnabled=true, version=}]])
15:41:08.029 INFO - Creating a new session for Capabilities [{nativeEvents=false, name=AmericaTest-firefox, browserName=firefox, javascriptEnabled=true, version=}]

When I connect to 127.0.0.1:7055 manually in google chrome or firefox, it gets the error page:

HTTP ERROR: 403

Forbidden for Proxy

RequestURI=/

Powered by Jetty://

But I can connect to http://127.0.0.1:4444/wd/hub/ which shows this selenium widget

the selenium hub page

And hitting "create a session" creates a blank firefox page, just like the tests are doing.

the hub creates blank sessions, to be expected, but this is all the tests do too

So yeah, how do I force the firefox tests to use the appropriate port, and make sure that that proxying port is all set for selenium?

Upvotes: 3

Views: 3217

Answers (1)

Duff
Duff

Reputation: 410

It seems that each release of Selenium only supports the latest stable version of Firefox. As stated below:

Each release of Selenium only supports Firefox N, N-1, ESR, & ESR-1 where N is the Firefox stable > channel at the time of release and ESR is the current ESR release. This means for Selenium 2.42 we > support Firefox 31 (N/ESR), 30 (N-1), 24 (ESR - 1). We should have the 2.43 release out within the > week, which will support 32 (N), 31 (N-1/ESR), 24 (ESR -1)

Have you tired to update Selenium or tried to use an older version of Firefox?

Upvotes: 4

Related Questions