如何让Firefox在Mac OSX上使用Selenium WebDriver [英] How to get Firefox working with Selenium WebDriver on Mac OSX
问题描述
我试图为 WebDriver
配置代理设置,所以我使用了下面的代码....
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference(network.proxy.type,1);
profile.setPreference(network.proxy.http,207.229.122.162);
profile.setPreference(network.proxy.http_port,3128);
WebDriver driver = new FirefoxDriver(profile);
selenium = new WebDriverBackedSelenium(driver,http://www.example.com/);
在执行文件后,我收到了异常...
org.openqa.selenium.WebDriverException:在PATH中找不到firefox二进制文件。
确保安装了firefox。操作系统似乎是:MAC
系统信息:os.name:'Mac OS X',os.arch:'x86_64',os.version:'10 .6.8 ',
java.version:'1.6.0_29'
$ b 驱动程序信息:driver.version:FirefoxDriver
任何人都可以帮我解释如何以及在哪里给路径 firefoxprofile()
我相信你有几个选择:
您的PATH系统变量中的文件夹(您的Firefox二进制文件所在) - 这里是< a>。 或者调用 I am trying to config proxy settings for the and after performing run on the file I am getting exception like ... org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: MAC System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.6.8', java.version: '1.6.0_29' Driver info: driver.version: FirefoxDriver Can anyone help me out regarding how and where to give path to I believe you have several options: Either specify the folder (in which your Firefox binary is) in your PATH system variable - here's how. Or call
这篇关于如何让Firefox在Mac OSX上使用Selenium WebDriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
WebDriver driver = new FirefoxDriver新的FirefoxBinary(新的文件(路径/你的/ firefox.exe)),配置文件);
WebDriver
so I have used the following code ....FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.proxy.type", 1);
profile.setPreference("network.proxy.http","207.229.122.162");
profile.setPreference("network.proxy.http_port", 3128);
WebDriver driver = new FirefoxDriver(profile);
selenium = new WebDriverBackedSelenium(driver, "http://www.example.com/");
firefoxprofile()
WebDriver driver = new FirefoxDriver(new FirefoxBinary(new File("path/to/your/firefox.exe")), profile);