Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.pojosontheweb.selenium;
 
 
 import java.io.File;
 
public class FirefoxBuildr {
    private File path;
    private FirefoxProfile profile;
    private String locales;
    public FirefoxBuildr setFirefoxPath(File path) {
        this. = path;
        return this;
    }
    public FirefoxBuildr setProfile(FirefoxProfile profile) {
        this. = profile;
        return this;
    }
    public FirefoxBuildr setLocales(String locales) {
        this. = locales;
        return this;
    }
    public WebDriver build() {
        if (==null) {
             = createFirefoxProfile();
        }
        if (!=null) {
            return new FirefoxDriver(new FirefoxBinary(), );
        } else {
            return new FirefoxDriver();
        }
    }
    public static FirefoxProfile createFirefoxProfile(String locales) {
        File tmpDir = new File(System.getProperty("java.io.tmpdir"), "wt-ffprofile");
        tmpDir.mkdirs();
        FirefoxProfile profile = new FirefoxProfile(tmpDir);
        if (locales !=null) {
            profile.setPreference("intl.accept_languages"locales);
        }
        return profile;
    }
New to GrepCode? Check out our FAQ X