Java Code Examples for org.openqa.selenium.opera.OperaOptions#setBinary()
The following examples show how to use
org.openqa.selenium.opera.OperaOptions#setBinary() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebDriverTypeTests.java From vividus with Apache License 2.0 | 5 votes |
@Test @PrepareForTest(fullyQualifiedNames = "org.vividus.selenium.WebDriverType$6") public void testGetOperaWebDriverWithAdditionalOptions() throws Exception { Map<String, String> experimentalOptionValue = singletonMap(OPTION_KEY, OPTION_VALUE); WebDriverConfiguration configuration = new WebDriverConfiguration(); configuration.setBinaryPath(Optional.of(PATH)); configuration.setCommandLineArguments(new String[] { ARGUMENT }); configuration.setExperimentalOptions(singletonMap(MOBILE_EMULATION, experimentalOptionValue)); OperaOptions operaOptions = new OperaOptions(); operaOptions.setBinary(PATH); operaOptions.addArguments(ARGUMENT); operaOptions.setExperimentalOption(MOBILE_EMULATION, experimentalOptionValue); testGetOperaWebDriver(configuration, operaOptions); }
Example 2
Source File: CreateRepositoryInGitHubStepDefinition.java From base_project_for_web_automation_projects with MIT License | 5 votes |
private void verifyIfDriverIsOpera() { if(OPERA.equals(System.getProperty("context"))){ OperaOptions operaOptions = new OperaOptions(); operaOptions.setBinary(System.getProperty("binary")); BrowseTheWeb.as(theActorCalled(CESAR)).setDriver(new OperaDriver(operaOptions)); } }
Example 3
Source File: OperaDriverHandler.java From selenium-jupiter with Apache License 2.0 | 5 votes |
@Override public MutableCapabilities getOptions(Parameter parameter, Optional<Object> testInstance) throws IOException, IllegalAccessException { OperaOptions operaOptions = new OperaOptions(); if (parameter != null) { // @Arguments Arguments arguments = parameter.getAnnotation(Arguments.class); if (arguments != null) { stream(arguments.value()).forEach(operaOptions::addArguments); } // @Extensions Extensions extensions = parameter.getAnnotation(Extensions.class); if (extensions != null) { for (String extension : extensions.value()) { operaOptions.addExtensions(getExtension(extension)); } } // @Binary Binary binary = parameter.getAnnotation(Binary.class); if (binary != null) { operaOptions.setBinary(binary.value()); } // @Options OperaOptions optionsFromAnnotatedField = annotationsReader .getFromAnnotatedField(testInstance, Options.class, OperaOptions.class); if (optionsFromAnnotatedField != null) { operaOptions = optionsFromAnnotatedField.merge(operaOptions); } } return operaOptions; }
Example 4
Source File: CustomDriverProvider.java From akita with Apache License 2.0 | 5 votes |
/** * Задает options для запуска Opera драйвера в контейнере Selenoid * options можно передавать, как системную переменную, например -Doptions=--load-extension=my-custom-extension * * @return operaOptions */ private OperaOptions getOperaRemoteDriverOptions(DesiredCapabilities capabilities) { log.info("---------------Opera Driver---------------------"); OperaOptions operaOptions = !this.options[0].equals("") ? (new OperaOptions()).addArguments(this.options) : new OperaOptions(); operaOptions.setCapability("browserVersion", PropertyLoader.loadSystemPropertyOrDefault("browserVersion", "latest")); operaOptions.setCapability("browserName", "opera"); operaOptions.setBinary(PropertyLoader.loadSystemPropertyOrDefault("webdriver.opera.driver", "/usr/bin/opera")); operaOptions.merge(capabilities); return operaOptions; }
Example 5
Source File: OperaUser.java From openvidu with Apache License 2.0 | 5 votes |
public OperaUser(String userName, int timeOfWaitInSeconds) { super(userName, timeOfWaitInSeconds); OperaOptions options = new OperaOptions(); options.setBinary("/usr/bin/opera"); DesiredCapabilities capabilities = DesiredCapabilities.operaBlink(); capabilities.setAcceptInsecureCerts(true); capabilities.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE); options.addArguments("--use-fake-ui-for-media-stream"); options.addArguments("--use-fake-device-for-media-stream"); capabilities.setCapability(OperaOptions.CAPABILITY, options); String REMOTE_URL = System.getProperty("REMOTE_URL_OPERA"); if (REMOTE_URL != null) { log.info("Using URL {} to connect to remote web driver", REMOTE_URL); try { this.driver = new RemoteWebDriver(new URL(REMOTE_URL), capabilities); } catch (MalformedURLException e) { e.printStackTrace(); } } else { log.info("Using local web driver"); this.driver = new OperaDriver(capabilities); } this.driver.manage().timeouts().setScriptTimeout(this.timeOfWaitInSeconds, TimeUnit.SECONDS); this.configureDriver(); }
Example 6
Source File: TestOperaBlinkDriver.java From selenium with Apache License 2.0 | 5 votes |
private static Capabilities operaWithCustomCapabilities(Capabilities originalCapabilities) { OperaOptions options = new OperaOptions(); options.addArguments("disable-extensions"); String operaPath = System.getProperty("webdriver.opera.binary"); if (operaPath != null) { options.setBinary(new File(operaPath)); } if (originalCapabilities != null) { options.merge(originalCapabilities); } return options; }