尝试在新的Windows PC上运行Behat。我安装了Firefox,并在我的路径中添加了位置,然后重新启动了终端。
我通过以下方式确认它在系统路径中:
echo %path%
,则变量以C:\Program Files (x86)\Mozilla Firefox;
结尾,这是正确的位置。where firefox
输出C:\Program Files (x86)\Mozilla Firefox\firefox.exe
firefox
即可启动浏览器。我运行了selenium,当我尝试启动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
我的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" }
答案 0 :(得分:0)
我认为路径需要指向.exe,而不仅仅是文件夹。尝试将路径变量设置为完整文件路径:
C:\ Program Files(x86)\ Mozilla Firefox \ Firefox.exe