Example usage for org.openqa.selenium.firefox FirefoxBinary addCommandLineOptions

List of usage examples for org.openqa.selenium.firefox FirefoxBinary addCommandLineOptions

Introduction

In this page you can find the example usage for org.openqa.selenium.firefox FirefoxBinary addCommandLineOptions.

Prototype

public void addCommandLineOptions(String... options) 

Source Link

Usage

From source file:de.learnlib.alex.learning.entities.webdrivers.FirefoxDriverConfig.java

License:Apache License

@Override
public WebDriver createDriver() throws Exception {
    final FirefoxBinary binary = new FirefoxBinary();
    if (headless) {
        binary.addCommandLineOptions("-headless");
    }// w  w w.j a  v a 2 s . c o  m

    final Map<String, String> environmentVariables = new HashMap<>();
    final WebDriver driver = new FirefoxDriver(new GeckoDriverService.Builder().usingFirefoxBinary(binary)
            .withEnvironment(environmentVariables).build());
    manage(driver);

    return driver;
}

From source file:org.bigtester.ate.model.page.atewebdriver.MyFirefoxDriver.java

License:Apache License

/**
 * {@inheritDoc}//from  w w  w .j a  v a  2 s  . c  o m
 */
@Override
public WebDriver getWebDriverInstance() {
    WebDriver retVal = super.getWebDriver();
    if (null == retVal) {
        BrowserProfile<FirefoxProfile> bPro = getBrowserProfile();
        if (null == bPro) {
            retVal = new FirefoxDriver();
        } else {
            FirefoxBinary binary = new FirefoxBinary();
            binary.addCommandLineOptions("-no-remote");
            retVal = new FirefoxDriver(binary, bPro.getProfile());
        }
        setWebDriver(retVal);

    }
    return retVal;
}