如何为Selenium明确指定Firefox的路径?

dfr*_*kow 10 python windows testing firefox selenium

我得到了Selenium IDE,跟着这篇帖子,得到了

python test_default_server.py
Run Code Online (Sandbox Code Playgroud)

它抱怨Firefox不在我的路上:

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
Run Code Online (Sandbox Code Playgroud)

我可以改变我的PATH环境变量,但我宁愿追求他们提到的本地配置选项("明确指定路径").我怎么做?"*firefox3c"是指什么?

Selenium 1.0.1,Python 2.5,Windows XP.

San*_*nti 16

实例化selenium而不是"*firefox"时,必须使用以下字符串:

"*firefox C:\\Program Files\\Mozilla Firefox\\firefox.exe"
Run Code Online (Sandbox Code Playgroud)

注意:我不确定路径是否正确,但它应该是类似的路径.

更新:您在哪里实例化您的浏览器?通过问题中的标签,我想你是一个蟒蛇家伙:

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()
Run Code Online (Sandbox Code Playgroud)