private WebDriver createEdgeDriver(Config config, Proxy proxy) { DesiredCapabilities capabilities = createCommonCapabilities(config, proxy); EdgeOptions options = new EdgeOptions(); options.merge(capabilities); if (!config.browserBinary().isEmpty()) { log.info("Using browser binary: " + config.browserBinary()); log.warning("Changing browser binary not supported in Edge, setting will be ignored."); } return new EdgeDriver(options); } }
public static WebDriver getDriver(String browserType, boolean headless){ if ( StringUtils.isEmpty(browserType) || FIREFOX.equals(browserType)) { return new FirefoxDriver(SeleniumBrowserFactory.getBrowserCapabilities(browserType, headless)); } else if (CHROME.equals(browserType)) { return new ChromeDriver(SeleniumBrowserFactory.getBrowserCapabilities(browserType, headless)); } else if (IE.equals(browserType)) { return new InternetExplorerDriver(SeleniumBrowserFactory.getBrowserCapabilities(browserType, false)); } else if (PHANTOMJS.equals(browserType)) { return new PhantomJSDriver(); } else if (SAFARI.equals(browserType)) { return new SafariDriver(); } else if (EDGE.equals(browserType)) { return new EdgeDriver(); } else { throw new RuntimeException(String.format("Unknown browser type: \"%s\"", browserType)); } }
/** * Creates a new EdgeDriver using the {@link EdgeDriverService#createDefaultService default} * server configuration. * * @see #EdgeDriver(EdgeDriverService, EdgeOptions) */ public EdgeDriver() { this(EdgeDriverService.createDefaultService(), new EdgeOptions()); }
@Override public WebDriver getDriver() { System.setProperty("webdriver.edge.driver", driverPath); // System.setProperty("webdriver.ie.driver.loglevel", "DEBUG"); org.openqa.selenium.edge.EdgeDriverService service = org.openqa.selenium.edge.EdgeDriverService.createDefaultService(); EdgeOptions options = new EdgeOptions(); return new EdgeDriver(service, options); } }
@Override public Optional<WebDriver> createDriver(Capabilities capabilities) throws SessionNotCreatedException { if (!isAvailable() || !isSupporting(capabilities)) { return Optional.empty(); } return Optional.of(new EdgeDriver(capabilities)); } }
/** * Creates a new EdgeDriver instance. The {@code service} will be started along with the driver, * and shutdown upon calling {@link #quit()}. * * @param service The service to use. * @see #EdgeDriver(EdgeDriverService, EdgeOptions) */ public EdgeDriver(EdgeDriverService service) { this(service, new EdgeOptions()); }
/** * Configures and returns a new {@link EdgeDriverService} using the default configuration. In * this configuration, the service will use the MicrosoftWebDriver executable identified by the * {@link #EDGE_DRIVER_EXE_PROPERTY} system property. Each service created by this method will * be configured to use a free port on the current system. * * @return A new EdgeDriverService using the default configuration. */ public static EdgeDriverService createDefaultService() { return new Builder().build(); }
/** * Get the EdgeDriverService to use. Exists to allow subclasses to override. * * @return the default Edge service. */ public EdgeDriverService getEdgeDriverService() { return EdgeDriverService.createDefaultService(); }
public EdgeOptions setProxy(Proxy proxy) { setCapability(CapabilityType.PROXY, proxy); return this; } }
@Override public void destroyInstance(EdgeDriver instance) { instance.quit(); }
@Override public WebDriver getWebDriver(Capabilities capabilities) { final EdgeOptions edgeOptions; if (capabilities instanceof EdgeOptions) { edgeOptions = (EdgeOptions) capabilities; } else { edgeOptions = new EdgeOptions().merge(capabilities); } return new EdgeDriver(edgeOptions); } }
/** * create native driver instance, designed for unit testing. * * @return the driver */ @Override protected WebDriver createNativeDriver() { return new EdgeDriver((EdgeOptions)driverOptions); }
private EdgeOptions getInitializedEdgeOptions() { if (this.edgeOptions == null) { this.edgeOptions = new EdgeOptions(); } return this.edgeOptions; }
/** * Creates a new EdgeDriver instance with the specified options. * * @param options The options to use. * @see #EdgeDriver(EdgeDriverService, EdgeOptions) */ public EdgeDriver(EdgeOptions options) { this(EdgeDriverService.createDefaultService(), options); }
@Override public WebDriver getWebDriverObject(DesiredCapabilities capabilities) { return new EdgeDriver(capabilities); } }
private EdgeOptions getInitializedEdgeOptions() { if (this.edgeOptions == null) { this.edgeOptions = new EdgeOptions(); } return this.edgeOptions; }
@Override public boolean isAvailable() { try { EdgeDriverService.createDefaultService(); return true; } catch (IllegalStateException | WebDriverException e) { return false; } }
public EdgeFactory() { super(new Function<DesiredCapabilities, WebDriver>() { @Override public WebDriver apply(DesiredCapabilities capabilities) { return new EdgeDriver(capabilities); } }); }
@Override public EdgeOptions getDefaultOptions() { return new EdgeOptions(); }
@Override protected WebDriver newDriverInstance(Capabilities capabilities) { return new EdgeDriver(capabilities); }