org.openqa.selenium.edge.EdgeDriverService Java Examples

The following examples show how to use org.openqa.selenium.edge.EdgeDriverService. 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: TestEdgeDriver.java    From selenium with Apache License 2.0 6 votes vote down vote up
private static URL getServiceUrl(Capabilities capabilities) {
  try {
    if (service == null) {
      Path logFile = Files.createTempFile("edgedriver", ".log");

      EdgeDriverService.Builder builder = new EdgeDriverService.Builder();
      service = builder.withVerbose(true).withLogFile(logFile.toFile()).build();
      LOG.info("edgedriver will log to " + logFile);
      service.start();
      Runtime.getRuntime().addShutdownHook(new Thread(() -> service.stop()));
    }
    return service.getUrl();
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
}
 
Example #2
Source File: EdgeWebDriverProxy.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Override
public DriverService createService(int port) {
    EdgeDriverService.Builder builder = new EdgeDriverService.Builder();
    BrowserConfig config = BrowserConfig.instance();
    String wdPath = config.getValue(BROWSER, "webdriver-exe-path");
    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));
    }
    return builder.usingPort(port).build();
}
 
Example #3
Source File: EdgeFactory.java    From webtester-core with Apache License 2.0 4 votes vote down vote up
public Browser createBrowser() {
    EdgeDriverService service = EdgeDriverService.createDefaultService();
    DesiredCapabilities capabilities = getDefaultCapabilities();
    return createBrowser(new EdgeDriver(service, capabilities));
}
 
Example #4
Source File: EdgeDriver.java    From selenium with Apache License 2.0 4 votes vote down vote up
public EdgeDriver(EdgeOptions options) {
  this(new EdgeDriverService.Builder().build(), options);
}
 
Example #5
Source File: EdgeDriver.java    From selenium with Apache License 2.0 4 votes vote down vote up
public EdgeDriver(EdgeDriverService service) {
  this(service, new EdgeOptions());
}
 
Example #6
Source File: EdgeDriver.java    From selenium with Apache License 2.0 4 votes vote down vote up
public EdgeDriver(EdgeDriverService service, EdgeOptions options) {
  super(new ChromiumDriverCommandExecutor("ms", service), Require.nonNull("Driver options", options), EdgeOptions.CAPABILITY);
}
 
Example #7
Source File: EdgeDriver.java    From selenium with Apache License 2.0 4 votes vote down vote up
@Deprecated
public EdgeDriver(Capabilities capabilities) {
  this(new EdgeDriverService.Builder().build(), new EdgeOptions().merge(capabilities));
}