org.openqa.selenium.firefox.internal.ProfilesIni Java Examples

The following examples show how to use org.openqa.selenium.firefox.internal.ProfilesIni. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FirefoxInterface.java    From candybean with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public void start() throws CandybeanException {
	String profileName = candybean.config.getValue("browser.firefox.profile", "default");
	File ffBinaryPath = new File(candybean.config.getPathValue("browser.firefox.binary"));
	if(!ffBinaryPath.exists()){
		String error = "Unable to find firefox browser driver from the specified location in the configuration file! \n"
				+ "Please add a configuration to the candybean config file for key \"browser.firefox.binary\" that"
				+ "indicates the location of the binary.";
		logger.severe(error);
		throw new CandybeanException(error);
	} else {
		FirefoxProfile ffProfile = (new ProfilesIni()).getProfile(profileName);
		FirefoxBinary ffBinary = new FirefoxBinary(ffBinaryPath);
		logger.info("Instantiating Firefox with profile name: "
				+ profileName + " and binary path: " + ffBinaryPath);
		super.wd = new FirefoxDriver(ffBinary, ffProfile);
		super.start(); // requires wd to be instantiated first
	}
}