1

I am unable to use arguments for new FirefoxDriver as per code:

        File pathBinary = new File("C:\\Users\\myname\\AppData\\Local\\Mozilla Firefox\\firefox.exe");
        FirefoxBinary firefoxBinary = new FirefoxBinary(pathBinary);
        FirefoxProfile firefoxProfile = new FirefoxProfile(); 
        WebDriver driver = new FirefoxDriver(firefoxBinary,firefoxProfile);
        //WebDriver driver = new FirefoxDriver();

I get an error saying "remove arguments to match FirefoxProfile();

When I try using just new FirefoxDriver() I get:

        org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: WIN8_1

I am using:

        geckodriver-v0.19.1-win32
        selenium-server-standalone-3.7.1

Any help most appreciated.

1
  • Which configuration are you exactly trying? FirefoxProfile and/or FirefoxBinary? Commented Nov 15, 2017 at 3:19

1 Answer 1

2

You need to pass them in as Firefox options try the following

FirefoxProfile ffprofile = new FirefoxProfile();
FirefoxBinary ffBinary = new FirefoxBinary(new File("path to your firefox 
executable"));
FirefoxOptions options = new FirefoxOptions();
options.setProfile(ffprofile);
options.setProfile(ffBinary);
options.setCapability(FirefoxOptions.FIREFOX_OPTIONS,options);
WebDriver driver = new FirefoxDriver(options);
Sign up to request clarification or add additional context in comments.

1 Comment

options.setBinary(ffBinary);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.