use of org.openqa.selenium.firefox.FirefoxDriver in project kotlin by JetBrains.
the class SeleniumFireFox method createFirefoxDriver.
public static FirefoxDriver createFirefoxDriver() {
FirefoxProfile profile = new FirefoxProfile();
FirefoxDriver answer = new FirefoxDriver(profile);
return answer;
}
use of org.openqa.selenium.firefox.FirefoxDriver in project jlineup by otto-de.
the class BrowserUtils method getWebDriverByConfig.
synchronized WebDriver getWebDriverByConfig(Config config, int width) {
WebDriver driver;
switch(config.browser) {
case FIREFOX:
FirefoxDriverManager.getInstance().setup();
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setProfile(getFirefoxProfileWithDisabledAnimatedGifs());
driver = new FirefoxDriver(firefoxOptions);
break;
case FIREFOX_HEADLESS:
FirefoxDriverManager.getInstance().setup();
FirefoxOptions firefoxOptionsForHeadless = new FirefoxOptions();
// Headless parameter is supported with Firefox >= 55
firefoxOptionsForHeadless.addArguments("--headless");
firefoxOptionsForHeadless.addArguments("-width", width + "", "-height", config.windowHeight + "");
firefoxOptionsForHeadless.setProfile(getFirefoxProfileWithDisabledAnimatedGifs());
driver = new FirefoxDriver(firefoxOptionsForHeadless);
break;
case CHROME:
ChromeDriverManager.getInstance().setup();
ChromeOptions options = new ChromeOptions();
// To work in a headless env, this is needed
options.addArguments("--no-sandbox");
driver = new ChromeDriver(options);
break;
case CHROME_HEADLESS:
ChromeDriverManager.getInstance().setup();
ChromeOptions options_headless = new ChromeOptions();
// To work in a headless env, this is needed
options_headless.addArguments("--no-sandbox", "--headless", "--disable-gpu");
options_headless.addArguments("--window-size=" + width + "," + config.windowHeight);
driver = new ChromeDriver(options_headless);
break;
case PHANTOMJS:
default:
PhantomJsDriverManager.getInstance().setup();
driver = new PhantomJSDriver();
break;
}
driver.manage().timeouts().pageLoadTimeout(config.pageLoadTimeout, TimeUnit.SECONDS);
return driver;
}
use of org.openqa.selenium.firefox.FirefoxDriver in project syndesis-qe by syndesisio.
the class CustomWebDriverProvider method prepareFirefoxDriver.
/**
* Method will prepare firefox driver with custom profile
* @return
*/
private FirefoxDriver prepareFirefoxDriver() {
// so far we only use firefox and chrome so lets set up firefox here
log.info("setting firefox profile");
System.setProperty("webdriver.gecko.driver", findDriverPath());
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setCapability("marionette", true);
firefoxOptions.addArguments("start-maximized");
firefoxOptions.addPreference("browser.download.folderList", 2);
firefoxOptions.addPreference("browser.download.manager.showWhenStarting", false);
firefoxOptions.addPreference("browser.download.panel.shown", false);
firefoxOptions.addPreference("browser.download.dir", DOWNLOAD_DIR);
firefoxOptions.addPreference("browser.download.useDownloadDir", true);
firefoxOptions.addPreference("browser.helperApps.neverAsk.saveToDisk", INTEGRATION_EXPORT_MIME_TYPE);
firefoxOptions.addPreference("javascript.enabled", true);
firefoxOptions.addPreference("app.update.enabled", false);
firefoxOptions.addPreference("app.update.service.enabled", false);
firefoxOptions.addPreference("app.update.auto", false);
firefoxOptions.addPreference("app.update.staging.enabled", false);
firefoxOptions.addPreference("app.update.silent", false);
firefoxOptions.addPreference("media.gmp-provider.enabled", false);
firefoxOptions.addPreference("extensions.update.autoUpdate", false);
firefoxOptions.addPreference("extensions.update.autoUpdateEnabled", false);
firefoxOptions.addPreference("extensions.update.enabled", false);
firefoxOptions.addPreference("extensions.update.autoUpdateDefault", false);
firefoxOptions.addPreference("extensions.logging.enabled", false);
firefoxOptions.addPreference("lightweightThemes.update.enabled", false);
return new FirefoxDriver(firefoxOptions);
}
use of org.openqa.selenium.firefox.FirefoxDriver in project Payara by payara.
the class SeleniumHelper method getSeleniumInstance.
public SeleniumWrapper getSeleniumInstance() {
if (selenium == null) {
if (Boolean.parseBoolean(SeleniumHelper.getParameter("debug", "false"))) {
logger.log(Level.INFO, "Creating new selenium instance");
}
String browser = getParameter("browser", "firefox");
if ("firefox".equals(browser)) {
driver = new FirefoxDriver();
} else if ("chrome".equals(browser)) {
driver = new ChromeDriver();
} else if ("ie".contains(browser)) {
driver = new InternetExplorerDriver();
}
elementFinder = new ElementFinder(driver);
selenium = new SeleniumWrapper(driver, getBaseUrl());
selenium.setTimeout("90000");
// Make sure the server has started and the user logged in
(new BaseSeleniumTestClass()).openAndWait("/", BaseSeleniumTestClass.TRIGGER_COMMON_TASKS, 480);
}
selenium.windowFocus();
selenium.windowMaximize();
selenium.setTimeout("90000");
return selenium;
}
use of org.openqa.selenium.firefox.FirefoxDriver in project Payara by payara.
the class BaseSeleniumTestClass method setUp.
@Before
public void setUp() throws Exception {
driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(90, TimeUnit.SECONDS);
}
Aggregations