if (StringUtils.isNotEmpty(profileName)) {
firefoxCapabilities.setCapability(FirefoxDriver.PROFILE, parser.getInstanciatedPath(profileName));
}
FirefoxProfile profile;
if (profileName == null) {
profile = createNewFirefoxProfile();
} else {
profile = getProfileFrom(profileName);
}
firefoxProfileEnhancer.allowWindowResizeFor(profile);
firefoxProfileEnhancer.activateNativeEventsFor(profile, shouldEnableNativeEvents());
if (shouldActivateProxy()) {
activateProxyFor(profile, firefoxProfileEnhancer);
}
if (firefoxProfileEnhancer.shouldActivateFirebugs()) {
firefoxProfileEnhancer.addFirebugsTo(profile);
}
if (refuseUntrustedCertificates()) {
profile.setAssumeUntrustedCertificateIssuer(false);
profile.setAcceptUntrustedCertificates(false);
} else {
profile.setAssumeUntrustedCertificateIssuer(true);
profile.setAcceptUntrustedCertificates(true);
}
firefoxProfileEnhancer.configureJavaSupport(profile);
firefoxProfileEnhancer.addPreferences(profile);
return profile;
}