org.openqa.selenium.opera.OperaDriverService Java Examples

The following examples show how to use org.openqa.selenium.opera.OperaDriverService. 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: OperaWebDriverProxy.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Override
public DriverService createService(int port) {
    BrowserConfig config = BrowserConfig.instance();
    String wdPath = config.getValue(BROWSER, "webdriver-exe-path");
    OperaDriverService.Builder builder = new OperaDriverService.Builder();
    if (wdPath != null)
        builder.usingDriverExecutable(new File(wdPath));
    String environ = config.getValue(BROWSER, "browser-environment");
    if (environ != null) {
        Map<String, String> envMap = new HashMap<>();
        BufferedReader reader = new BufferedReader(new StringReader(environ));
        String line = null;
        try {
            while ((line = reader.readLine()) != null) {
                String[] parts = line.split("=");
                if (parts != null && parts.length == 2) {
                    envMap.put(parts[0], parts[1]);
                }
            }
        } catch (IOException e) {
        }
        builder.withEnvironment(envMap);
    }
    String logFile = config.getValue(BROWSER, "webdriver-log-file-path");
    if (logFile != null) {
        builder.withLogFile(new File(logFile));
    }
    builder.withVerbose(config.getValue(BROWSER, "webdriver-verbose", false));
    builder.withSilent(config.getValue(BROWSER, "webdriver-silent", true));
    return builder.usingPort(port).build();
}
 
Example #2
Source File: TestOperaBlinkDriver.java    From selenium with Apache License 2.0 5 votes vote down vote up
private static URL getServiceUrl() {
  if (service == null) {
    service = OperaDriverService.createDefaultService();
    try {
      service.start();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }

    // Fugly.
    Runtime.getRuntime().addShutdownHook(new Thread(() -> service.stop()));
  }
  return service.getUrl();
}
 
Example #3
Source File: OperaDriver.java    From selenium with Apache License 2.0 3 votes vote down vote up
/**
 * Creates a new OperaDriver instance. The {@code service} will be started along with the
 * driver, and shutdown upon calling {@link #quit()}.
 *
 * @param service The service to use.
 * @param capabilities The capabilities required from the OperaDriver.
 * @deprecated Use {@link #OperaDriver(OperaDriverService, OperaOptions)} instead.
 */
@Deprecated
public OperaDriver(OperaDriverService service, Capabilities capabilities) {
  super(new DriverCommandExecutor(service), capabilities);
  locationContext = new RemoteLocationContext(getExecuteMethod());
  webStorage = new  RemoteWebStorage(getExecuteMethod());
}
 
Example #4
Source File: OperaDriver.java    From selenium with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new OperaDriver using the {@link OperaDriverService#createDefaultService default}
 * server configuration.
 *
 * @see #OperaDriver(OperaDriverService, OperaOptions)
 */
public OperaDriver() {
  this(OperaDriverService.createDefaultService(), new OperaOptions());
}
 
Example #5
Source File: OperaDriver.java    From selenium with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new OperaDriver instance. The {@code service} will be started along with the driver,
 * and shutdown upon calling {@link #quit()}.
 *
 * @param service The service to use.
 * @see #OperaDriver(OperaDriverService, OperaOptions)
 */
public OperaDriver(OperaDriverService service) {
  this(service, new OperaOptions());
}
 
Example #6
Source File: OperaDriver.java    From selenium with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new OperaDriver instance. The {@code capabilities} will be passed to the
 * chromedriver service.
 *
 * @param capabilities The capabilities required from the OperaDriver.
 * @see #OperaDriver(OperaDriverService, Capabilities)
 * @deprecated Use {@link #OperaDriver(OperaOptions)} instead.
 */
@Deprecated
public OperaDriver(Capabilities capabilities) {
  this(OperaDriverService.createDefaultService(), capabilities);
}
 
Example #7
Source File: OperaDriver.java    From selenium with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new OperaDriver instance with the specified options.
 *
 * @param options The options to use.
 * @see #OperaDriver(OperaDriverService, OperaOptions)
 */
public OperaDriver(OperaOptions options) {
  this(OperaDriverService.createDefaultService(), options);
}
 
Example #8
Source File: OperaDriver.java    From selenium with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new OperaDriver instance with the specified options. The {@code service} will be
 * started along with the driver, and shutdown upon calling {@link #quit()}.
 *
 * @param service The service to use.
 * @param options The options to use.
 */
public OperaDriver(OperaDriverService service, OperaOptions options) {
  this(service, (Capabilities) options);
}