How to explicitly specify a path to Firefox for Selenium?

后端 未结 8 2303
伪装坚强ぢ
伪装坚强ぢ 2021-02-14 14:16

I got Selenium IDE, followed this post, got to

python test_default_server.py

and it complains Firefox is not in my path:

Please         


        
8条回答
  •  遥遥无期
    2021-02-14 14:37

    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()
    

提交回复
热议问题