views:

2847

answers:

3

I got Selenium IDE, followed this post, got to

python test_default_server.py

and it complains Firefox is not in my 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

I could change my PATH environment variable, but I'd rather pursue the local config option they are mentioning ("explicitly specify a path"). How do I do that? What does the "*firefox3c" refer to?

Selenium 1.0.1, Python 2.5, Windows XP.

+4  A: 

You have to use the following string when you instantiate selenium instead of just "*firefox":

"*firefox C:\Program Files\Mozilla Firefox\firefox.exe"

Notice: I'm not sure that path is correct, but it should be a similar one.

Update: Where do you instantiate your browser? By the tags in the question I suppose you're a python guy:

def setUp(self):
    self.verificationErrors = []
    self.selenium = selenium("localhost", 4444, "*firefox C:\Program Files\Mozilla Firefox\firefox.exe", "http://change-this-to-the-site-you-are-testing/")
    self.selenium.start()
Santi
where do you instantiate selenium? You mean at the command line? Is it a command-line arg?
dfrankow
Updated the answer
Santi
Did this work? The answer is not marked yet
Santi
Notice that you'll neet to add r as a prefix to "*firefox..." as it - r"*firefox C:\Program Files\Mozilla Firefox\firefox.exe". This fixed the problem for me.
Jonathan
A: 

The *firefox etc are the keys for which browser to use to run the tests.

There is a long list of them at http://stackoverflow.com/questions/1317055/how-to-run-google-chrome-with-selenium-rc/1317131#1317131 - so you can target Firefox v2 (firefox2), Firefox v3 (firefox3), Google Chrome (*googlechrome) etc

Jane
Where do you use the keys?
dfrankow
in the initialisation,i.e. selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://stackoverflow.com");Replace the "*chrome" bit with any of those keys to target a different browser
Jane