21
votes

I try to get started with selenium (downloaded the current version today) and copied their example which opens a browser and performs a google search.

However, the program hangs forever in the 1st line WebDriver driver = new FirefoxDriver();.

I have Firefox 13 installed.

Thread dump:
Thread [main]
  Thread.sleep(long) line: not available [native method] [local variables unavailable]
  FirefoxBinary.sleep(long) line: 218
  FirefoxBinary.clean(FirefoxProfile, File) line: 234
  NewProfileExtensionConnection.start() line: 76
  FirefoxDriver.startClient() line: 200
  FirefoxDriver(RemoteWebDriver).(CommandExecutor, Capabilities) line: 94
  FirefoxDriver.(FirefoxBinary, FirefoxProfile) line: 147
  FirefoxDriver.() line: 85
  Test.main(String[]) line: 24
5

5 Answers

23
votes

These cases are usually when Firefox & Selenium are a little "out of sync" in terms of compatibility.

You should try two things: update Selenium to the latest one and/or downgrade Firefox. Keeping an eye on the Selenium Release Notes

0
votes

Normally a new browser's hot - I was looking for a problem elsewhere. Webdriver or selenium server. http://d.pr/i/Q5Dt

0
votes

I've been working OK with Firefox 18, but I just got auto-updated to 19 which seems to break the webdriver. Mozilla isn't prominent with the links to prior versions:

https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/18.0b7/mac/en-US/

0
votes

Saw this behavior when trying to instantiate the webdriver on a headless CentOS server without display being set.

Per https://serverfault.com/questions/363827/how-can-i-run-firefox-on-centos-with-no-display -- you can use Xvfb, which gives you an X server that doesn't require connection to a physical display