The following piece of code is used to kick start the firefox
public static WebDriver driverSetUp() {
// FirefoxBinary bin = new FirefoxBinary(new
// File("C:\\Program Files\\Mozilla Firefox 3.6\\firefox.exe"));
// driver = new FirefoxDriver(bin, new FirefoxProfile());
// sets up the driver and browser
FirefoxProfile profile = new FirefoxProfile();
profile.setEnableNativeEvents(false);
profile.setPreference("dom.max_script_run_time", 100);
WebDriver driver = new FirefoxDriver(profile);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(waitTime, TimeUnit.SECONDS);
return driver;
}
Now the long story short, on the development environments (within eclipse) which can be a combination of : Win2003/Win7 (few cases Windows2008R2) with FF 17, 18, 20, 21, or ESR 17.0.x (having either selenium 2.31 or 2.32 code level), the browser opens on the following call
WebDriver driver = new FirefoxDriver(profile);
for a short time, then closes, after another 1-2 seconds it opens again, but I guess the initial handle is lost and InvocationTargetException happens.
On the regression environments (driven through ant), which most of the cases is Win2008R2 with FF18, ESR 17.0.x or FF 20 it all works fine.
I haven't got down into debugging the selenium source code, I suspect that there is something with the environment that causes this, I wonder is anyone else have encountered something similar or if you have any recommendations on how to debug further ? Thx