PATH to Firefox [message #718540] |
Wed, 24 August 2011 16:12  |
Eclipse User |
|
|
|
Hi everyone...my first post so please go easy on me!
Also trying to post this message was impossible becase this forum wont let new users post links so where I say "G UK" in my code, please assume this is a link to google UK.
I'm trying to use eclipse with Selenium, here's my code:
package com.eviltester.seleniumtutorials;
import com.thoughtworks.selenium.*;
public class MyFirstSeleniumTests extends SeleneseTestCase {
public void setUp() throws Exception {
setUp("G UK", "*firefox");
}
public void testGoogle_for_selenium_rc() throws Exception {
selenium.open("/");
selenium.type("q", "Selenium-RC");
selenium.click("btnG");
}
}
Running the latest eclipse build but Firefox 3.6.2 (for testing purposes).
I'm having problems with the following line:
setUp("G UK", "*firefox");
error:
java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: java.lang.RuntimeException: Firefox 3 could not be found in the path!
Please add the directory containing ''firefox.exe'' to your PATH environment
variable, or explicitly specify a path to Firefox 3 like this:
*firefox3c:\blah\firefox.exe
So then changing the line to be:
setUp("G UK", "*firefox3c:\Program Files (x86)\Mozilla Firefox\firefox.exe");
I get the following new error:
java.lang.Error: Unresolved compilation problem:
Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )
Thanks for all your help in advance,
Rgds,
Neal
|
|
|
|
Re: PATH to Firefox [message #718592 is a reply to message #718556] |
Wed, 24 August 2011 18:56   |
Eclipse User |
|
|
|
You need to escape the \ characters in the path. You escape a \ character by using \\. In your case you would enter c:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"
|
|
|
Re: PATH to Firefox [message #718747 is a reply to message #718592] |
Thu, 25 August 2011 08:47  |
Eclipse User |
|
|
|
Excellent, works like a treat with the \\ . Thanks alot for your help. Also incase anyone else is having problems, you must include the h t t p : / / for the link. (I still cant post links, remove the spaces!).
Thanks again!
|
|
|
Powered by
FUDForum. Page generated in 0.16405 seconds