Example usage for org.openqa.selenium.opera OperaOptions addArguments

List of usage examples for org.openqa.selenium.opera OperaOptions addArguments

Introduction

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

Prototype

public OperaOptions addArguments(List<String> arguments) 

Source Link

Document

Adds additional command line arguments to be used when starting Opera.

Usage

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  w  w . jav a2s.  c  o  m*/
    WebDriver driver = new OperaDriver(operaOptions);
    return driver;
}