Search in sources :

Example 1 with OperaOptions

use of org.openqa.selenium.opera.OperaOptions in project webdrivermanager by bonigarcia.

the class OperaTest method setupTest.

@Before
public void setupTest() {
    File operaBinary = IS_OS_WINDOWS ? new File("C:\\Program Files\\Opera\\launcher.exe") : new File("/usr/bin/opera");
    assumeTrue(operaBinary.exists());
    OperaOptions options = new OperaOptions();
    options.setBinary(operaBinary);
    driver = new OperaDriver(options);
}
Also used : OperaDriver(org.openqa.selenium.opera.OperaDriver) File(java.io.File) OperaOptions(org.openqa.selenium.opera.OperaOptions) Before(org.junit.Before)

Example 2 with OperaOptions

use of org.openqa.selenium.opera.OperaOptions in project nutch by apache.

the class HttpWebClient method createOperaWebDriver.

public static WebDriver createOperaWebDriver(String operaDriverPath, boolean enableHeadlessMode) {
    // if not specified, WebDriver will search your path for operadriver
    System.setProperty("webdriver.opera.driver", operaDriverPath);
    OperaOptions operaOptions = new OperaOptions();
    // operaOptions.setBinary("/usr/bin/opera");
    operaOptions.addArguments("--no-sandbox");
    operaOptions.addArguments("--disable-extensions");
    // to your server
    if (enableHeadlessMode) {
        operaOptions.addArguments("--headless");
    }
    WebDriver driver = new OperaDriver(operaOptions);
    return driver;
}
Also used : WebDriver(org.openqa.selenium.WebDriver) RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) OperaDriver(org.openqa.selenium.opera.OperaDriver) OperaOptions(org.openqa.selenium.opera.OperaOptions)

Example 3 with OperaOptions

use of org.openqa.selenium.opera.OperaOptions in project ifml2php by Dipiert.

the class Form_test method loadOperaDriver.

private void loadOperaDriver() {
    System.setProperty("webdriver.opera.driver", "drivers/operadriver");
    OperaOptions operaOptions = new OperaOptions();
    operaOptions.addArguments("--no-sandbox");
    drivers.add(new OperaDriver(operaOptions));
}
Also used : OperaDriver(org.openqa.selenium.opera.OperaDriver) OperaOptions(org.openqa.selenium.opera.OperaOptions)

Example 4 with OperaOptions

use of org.openqa.selenium.opera.OperaOptions in project ifml2php by Dipiert.

the class Page_test method loadOperaDriver.

private static void loadOperaDriver() {
    System.setProperty("webdriver.opera.driver", "drivers/operadriver");
    OperaOptions operaOptions = new OperaOptions();
    operaOptions.addArguments("--no-sandbox");
    drivers.add(new OperaDriver(operaOptions));
}
Also used : OperaDriver(org.openqa.selenium.opera.OperaDriver) OperaOptions(org.openqa.selenium.opera.OperaOptions)

Aggregations

OperaDriver (org.openqa.selenium.opera.OperaDriver)4 OperaOptions (org.openqa.selenium.opera.OperaOptions)4 File (java.io.File)1 Before (org.junit.Before)1 WebDriver (org.openqa.selenium.WebDriver)1 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)1