Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to config proxy settings for the 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/");

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
448 views
Welcome To Ask or Share your Answers For Others

1 Answer

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

WebDriver driver = new FirefoxDriver(new FirefoxBinary(new File("path/to/your/firefox.exe")), profile);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...