List of usage examples for org.openqa.selenium.opera OperaOptions OperaOptions
public OperaOptions()
From source file:endtoend.browser.driver.builders.OperaDriverBuilderTest.java
License:Apache License
@Test(expected = DriverBuilderTestUtil.VerySpecialExceptionOnlyWeThrow.class) public void withOptions() { // given/*w ww. ja v a 2 s. co m*/ OperaOptions operaOptions = new OperaOptions() { @Override public boolean is(String capabilityName) { throw new DriverBuilderTestUtil.VerySpecialExceptionOnlyWeThrow(); } }; // when $.driver().useOpera().autoDriverDownload().withOptions(operaOptions); DriverBuilderTestUtil.openAnyUrl(); // then // exception is thrown when the browser inits with the passed options }
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); }/* w w w . ja va 2 s. c o m*/ driver = new OperaDriver(capabilities); }
From source file:io.github.seleniumquery.browser.driver.builders.OperaDriverBuilder.java
License:Apache License
private OperaOptions getInitializedOperaOptions() { if (this.operaOptions == null) { this.operaOptions = new OperaOptions(); }//from ww w .j a v a 2 s. c o m return this.operaOptions; }
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"); }/*from ww w. j a v a 2s . c om*/ WebDriver driver = new OperaDriver(operaOptions); return driver; }
From source file:ug.lab.proj5.opera.OperaInfoTypeTest.java
@Before @Override/* w ww . j a va2 s .c om*/ 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); }