First let me apologize for creating another thread. The first one had
become too unwieldy and I wanted to condense everything down.
My tests run fine in java and fitnesse. They also run fine when
executing them through robot framework with Internet Explorer and
Chrome. However when I execute them through Firefox, using 'new
FirefoxDriver()', I receive the following error:
DEBUG java.lang.ExceptionInInitializerError
at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:
81)
Caused by: java.lang.NullPointerException
org.openqa.selenium.firefox.FirefoxBinary.<clinit>(FirefoxBinary.java:
42)
... 183 more
In the FirefoxBinary and FirefoxDriver classes these lines correspond
to the following code:
FirefoxBinary ln42-43
private static final String PATH_PREFIX = "/" +
FirefoxBinary.class.getPackage().getName().replace(".", "/") +
"/";
and FirefoxDriver ln 80-82
public FirefoxDriver(FirefoxProfile profile) {
this(new FirefoxBinary(), profile);
}
I have tried setting the path to the Firefox binary in my classpath,
pythonpath (used by robotframework) and path. I have also written the
following lines of code to try to force the binary to be found:
System.setProperty("webdriver.firefox.bin", "C:\\Program Files (x86)\
\Mozilla Firefox\\firefox.exe");
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(FirefoxDriver.BINARY, "C:\\Program Files (x86)\
\Mozilla Firefox\\firefox.exe");
I have tried to execute the tests on two computers, my work and home
machines. Further I have tried to use a firefox profile created using
firefox.exe –p and also by creating one in the java code. I have
tried Firefox 6-8. Unfortunately none of these things have worked.
I am also using/have used:
Java 1.6
Selenium 2.9.0/2.13.0
Windows 7
I am unsure if this is related but as a work around I have been trying
to get Firefox to run through a remote browser. I have been trying
the following code:
rcc = new RemoteControlConfiguration();
rcc.setPort(4447);
rcc.setPortDriversShouldContact(4447);
rcc.setInteractive(true);
rcc.setSingleWindow(true);
rcc.setTimeoutInSeconds(30);
ss = new SeleniumServer(rcc);
ss.start();
DesiredCapabilities cap = new DesiredCapabilities();
cap.setJavascriptEnabled(true);
cap.setBrowserName("firefox");
URL url = new URL ("http://www.google.com/");
driver = new RemoteWebDriver(url,cap);
However when I run the above I get the following error message:
Exception in thread "main" org.openqa.selenium.WebDriverException:
Error communicating with the remote browser. It may have died.
Build info: version: '2.13.0', revision: '14794', time: '2011-11-18
17:49:47'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version:
'6.1', java.version: '1.7.0'
Driver info: driver.version: Selenium2Driver
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
412)
Does anyone have any idea on how to fix either of my problems?
Any help would be greatly appreciated, I feel very stuck on this issue
atm. Two days of trying to get Firefox to work when Internet Explorer
already does….. It feels as if the world is about to end.
Thanks,
James
On Nov 23, 4:22 pm, James <jamesfarr...@gmail.com> wrote:
> Unableto find/openFirefoxBinary- webdriver/robot framework
>
> First let me apologize for creating another thread. The first one had
> become too unwieldy and I wanted to condense everything down.
> My tests run fine in java and fitnesse. They also run fine when
> executing them through robot framework with Internet Explorer and
> Chrome. However when I execute them throughFirefox, using 'new
> FirefoxDriver()', I receive the following error:
>
> DEBUG java.lang.ExceptionInInitializerError
> at
> org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:
> 81)
> Caused by: java.lang.NullPointerException
> org.openqa.selenium.firefox.FirefoxBinary.<clinit>(FirefoxBinary.java:
> 42)
> ... 183 more
>
> In the FirefoxBinary and FirefoxDriver classes these lines correspond
> to the following code:
>
> FirefoxBinary ln42-43
> private static final String PATH_PREFIX = "/" +
> FirefoxBinary.class.getPackage().getName().replace(".", "/") +
> "/";
>
> and FirefoxDriver ln 80-82
> public FirefoxDriver(FirefoxProfile profile) {
> this(new FirefoxBinary(), profile);
> }
>
> I have tried setting the path to theFirefoxbinaryin my classpath,
> pythonpath (used by robotframework) and path. I have also written the
> following lines of code to try to force thebinaryto be found:
>
> System.setProperty("webdriver.firefox.bin", "C:\\Program Files (x86)\
> \MozillaFirefox\\firefox.exe");
> DesiredCapabilities cap = new DesiredCapabilities();
> cap.setCapability(FirefoxDriver.BINARY, "C:\\Program Files (x86)\
> \MozillaFirefox\\firefox.exe");
>
> I have tried to execute the tests on two computers, my work and home
> machines. Further I have tried to use afirefoxprofile created usingfirefox.exe –p and also by creating one in the java code. I have
> triedFirefox6-8. Unfortunately none of these things have worked.
>
> I am also using/have used:
> Java 1.6
> Selenium 2.9.0/2.13.0
> Windows 7
>
> I am unsure if this is related but as a work around I have been trying
> to getFirefoxto run through a remote browser. I have been trying
> atm. Two days of trying to getFirefoxto work when Internet Explorer