简体   繁体   English

Behat说在路径中找不到Firefox Binary,但是在路径中

[英]Behat says Firefox Binary not found in path, but it's in path

Trying to run Behat on a new Windows PC. 尝试在新的Windows PC上运行Behat。 I installed Firefox, and added the location to my path, and restarted the terminal. 我安装了Firefox,并将位置添加到我的路径中,然后重新启动了终端。

I confirmed it's in the system path by: 我通过以下方法确认它在系统路径中:

  1. If I do echo %path% , the variable ends in C:\\Program Files (x86)\\Mozilla Firefox; 如果执行echo %path% ,则变量以C:\\Program Files (x86)\\Mozilla Firefox;结尾C:\\Program Files (x86)\\Mozilla Firefox; which is the correct location. 这是正确的位置。
  2. where firefox outputs C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe where firefox输出C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe
  3. typing just firefox into the console launches the browser. 在控制台中仅输入firefox启动浏览器。

I have selenium running, and when I try to launch the behat test, I get this error. 我正在运行硒,当我尝试启动behat测试时,出现此错误。

[WebDriver\Exception\UnknownError]

Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTA

Build info: version: '2.38.0', revision: 'bd32d4e', time: '2013-12-05 16:15:38'

System info: host: 'Jessica-DELL', ip: '192.168.1.85', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_40'
Driver info: driver.version: FirefoxDriver

My behat config file (which works on other PCs) is as follows. 我的behat配置文件(可在其他PC上使用)如下。

  extensions:
    Behat\Symfony2Extension\Extension:
      mink_driver: true
      kernel:
        env: test
        debug: true
    Behat\MinkExtension\Extension:
      default_session: symfony2
      javascript_session: selenium2
      goutte:    ~
      selenium2:
        capabilities: { "browser": "firefox", browserName: "firefox", "version": "29" }

I believe the path needs to point to the .exe, not just the folder. 我认为路径需要指向.exe,而不仅仅是文件夹。 Try setting the path variable to the full filepath: 尝试将路径变量设置为完整文件路径:

C:\\Program Files (x86)\\Mozilla Firefox\\Firefox.exe C:\\ Program Files(x86)\\ Mozilla Firefox \\ Firefox.exe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM