use of org.asqatasun.sebuilder.tools.ProfileFactory in project Asqatasun by Asqatasun.
the class WebDriverFactory method getFirefoxDriver.
/**
* This methods creates a firefoxDriver instance and set a DISPLAY
* environment variable
* @param display
* @return an instance of firefoxDriver
*/
public FirefoxDriver getFirefoxDriver(String display) {
if (webDriver == null) {
FirefoxBinary ffBinary = new FirefoxBinary();
if (StringUtils.isNotBlank(display)) {
Logger.getLogger(this.getClass()).info("Setting Xvfb display with value " + display);
ffBinary.setEnvironmentProperty("DISPLAY", display);
}
ProfileFactory pf = ProfileFactory.getInstance();
webDriver = new FirefoxDriver(ffBinary, pf.getOnlineProfile());
webDriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
webDriver.manage().timeouts().pageLoadTimeout(310, TimeUnit.SECONDS);
}
return webDriver;
}
Aggregations