Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » PATH to Firefox
PATH to Firefox [message #718540] Wed, 24 August 2011 16:12 Go to next message
Neal  is currently offline Neal Friend
Messages: 3
Registered: August 2011
Junior Member
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 #718556 is a reply to message #718540] Wed, 24 August 2011 16:48 Go to previous messageGo to next message
Neal  is currently offline Neal Friend
Messages: 3
Registered: August 2011
Junior Member
I've attached the code just in-case.

Thanks again!

Neal
Re: PATH to Firefox [message #718592 is a reply to message #718556] Wed, 24 August 2011 18:56 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
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 Go to previous message
Neal  is currently offline Neal Friend
Messages: 3
Registered: August 2011
Junior Member
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!
Previous Topic:Can't set modifier to Method declaration
Next Topic:problems with EclipseShell (BeanShell)
Goto Forum:
  


Current Time: Thu Mar 28 13:09:41 GMT 2024

Powered by FUDForum. Page generated in 0.01694 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top