Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium hangs instantiating FirefoxDriver

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
like image 383
stracktracer Avatar asked May 23 '12 07:05

stracktracer


2 Answers

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

like image 126
Arran Avatar answered Oct 27 '22 15:10

Arran


Firefox 13 support was added in Selenium 2.23. See http://code.google.com/p/selenium/source/browse/trunk/java/CHANGELOG

like image 44
user405935 Avatar answered Oct 27 '22 16:10

user405935