类org.openqa.selenium.opera.OperaDriverService源码实例Demo

下面列出了怎么用org.openqa.selenium.opera.OperaDriverService的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: marathonv5   文件: OperaWebDriverProxy.java
@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();
}
 
源代码2 项目: selenium   文件: TestOperaBlinkDriver.java
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();
}
 
源代码3 项目: selenium   文件: OperaDriver.java
/**
 * 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());
}
 
源代码4 项目: selenium   文件: OperaDriver.java
/**
 * Creates a new OperaDriver using the {@link OperaDriverService#createDefaultService default}
 * server configuration.
 *
 * @see #OperaDriver(OperaDriverService, OperaOptions)
 */
public OperaDriver() {
  this(OperaDriverService.createDefaultService(), new OperaOptions());
}
 
源代码5 项目: selenium   文件: OperaDriver.java
/**
 * 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());
}
 
源代码6 项目: selenium   文件: OperaDriver.java
/**
 * 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);
}
 
源代码7 项目: selenium   文件: OperaDriver.java
/**
 * 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);
}
 
源代码8 项目: selenium   文件: OperaDriver.java
/**
 * 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);
}
 
 类所在包
 类方法
 同包方法