Example usage for org.openqa.selenium.opera OperaDriver OperaDriver

List of usage examples for org.openqa.selenium.opera OperaDriver OperaDriver

Introduction

In this page you can find the example usage for org.openqa.selenium.opera OperaDriver OperaDriver.

Prototype

public OperaDriver(OperaOptions options) 

Source Link

Document

Creates a new OperaDriver instance with the specified options.

Usage

From source file:io.github.bonigarcia.wdm.test.OperaTest.java

License:Open Source License

@Before
public void setupTest() {
    DesiredCapabilities capabilities = DesiredCapabilities.operaBlink();
    if (IS_OS_LINUX) {
        assumeTrue("no Opera installed on Linux; well ... :-)", new File("/usr/bin/opera").exists());
        OperaOptions options = new OperaOptions();
        options.setBinary(new File("/usr/bin/opera"));
        capabilities.setCapability(OperaOptions.CAPABILITY, options);
    }/*from   ww  w . j  av a2  s .  c om*/
    driver = new OperaDriver(capabilities);
}

From source file:io.github.seleniumquery.browser.driver.builders.OperaDriverBuilder.java

License:Apache License

private WebDriver buildOpera() {
    try {/*from ww  w . j a va 2 s  .c o m*/
        return new OperaDriver(getInitializedOperaOptions());
    } catch (IllegalStateException e) {
        throwCustomExceptionIfExecutableWasNotFound(e);
        throw e;
    } catch (WebDriverException e) {
        throwCustomExceptionIfBinaryWasNotFound(e);
        throw e;
    }
}

From source file:org.apache.nutch.protocol.selenium.HttpWebClient.java

License:Apache License

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");
    // be sure to set selenium.enable.headless to true if no monitor attached
    // to your server
    if (enableHeadlessMode) {
        operaOptions.addArguments("--headless");
    }/* w  ww . j  a  v a2 s .c o  m*/
    WebDriver driver = new OperaDriver(operaOptions);
    return driver;
}

From source file:ug.lab.proj5.opera.OperaInfoTypeTest.java

@Before
@Override//from  w ww .  j  a  v a  2 s.  com
public void driverSetup() {
    File file = new File("../libs/operadriver_64.exe");
    System.setProperty("webdriver.opera.driver", file.getAbsolutePath());

    OperaOptions options = new OperaOptions();
    options.setBinary("E:/Data/PortableApps/OperaPortable/App/Opera/36.0.2130.32/Opera.exe");
    //options.setBinary("E:/Data/PortableApps/OperaPortable/OperaPortable.exe");

    driver = new OperaDriver(options);
    driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
}