Class AbstractDriverFactory

java.lang.Object
com.codeborne.selenide.webdriver.AbstractDriverFactory
All Implemented Interfaces:
DriverFactory
Direct Known Subclasses:
AbstractChromiumDriverFactory, DefaultDriverFactory, FirefoxDriverFactory, HtmlUnitDriverFactory, InternetExplorerDriverFactory, SafariDriverFactory

public abstract class AbstractDriverFactory extends Object implements DriverFactory
  • Constructor Details

    • AbstractDriverFactory

      public AbstractDriverFactory()
  • Method Details

    • webdriverLog

      protected File webdriverLog(Config config)
    • findBinariesWithoutSelenideProxy

      protected void findBinariesWithoutSelenideProxy(@Nullable org.openqa.selenium.Proxy proxy, org.openqa.selenium.remote.service.DriverService service, org.openqa.selenium.MutableCapabilities options, Consumer<String> setBrowserBinary)
      Selenium passes the browser's proxy to Selenium Manager, so Selenium Manager would go through Selenide's MITM proxy to download drivers/browsers. Selenium Manager doesn't trust the MITM certificate (since 4.52.0 it even breaks its json output). So we find the driver (and browser) bypassing Selenide proxy, and Selenium will not run Selenium Manager anymore.

      If Selenide proxy is chained to an outside proxy (e.g. a corporate proxy), Selenium Manager uses the outside proxy. If Selenide proxy is not used, Selenium passes the user's proxy (if any) to Selenium Manager as usual.

      See Selenium issue 18263

    • withLog

      protected <DS extends org.openqa.selenium.remote.service.DriverService, B extends org.openqa.selenium.remote.service.DriverService.Builder<DS, ?>> DS withLog(Config config, B dsBuilder)
    • setTimezone

      protected void setTimezone(Config config, org.openqa.selenium.remote.service.DriverService.Builder<?,?> dsBuilder)
      The browser inherits environment variables from the webdriver process, so the whole browser (all tabs, windows and workers) uses this timezone.
    • isWindows

      protected boolean isWindows()
    • createCommonCapabilities

      protected org.openqa.selenium.MutableCapabilities createCommonCapabilities(Config config, Browser browser, @Nullable org.openqa.selenium.Proxy proxy)
    • createCommonCapabilities

      protected <T extends org.openqa.selenium.MutableCapabilities> T createCommonCapabilities(T capabilities, Config config, Browser browser, @Nullable org.openqa.selenium.Proxy proxy)
    • timezone

      protected @Nullable String timezone(Config config)
      Browsers silently fall back to UTC for an unknown timezone, so we fail fast on a typo.

      Only tz database IDs are accepted (e.g. "Europe/Tallinn", "UTC", "Etc/GMT-2"). Offset-style IDs like "GMT+02:00" are rejected: Java reads it as UTC+2, but TZ reads it as UTC-2.

    • merge

      protected <T extends org.openqa.selenium.MutableCapabilities> T merge(T capabilities, org.openqa.selenium.MutableCapabilities additionalCapabilities)
    • transferCapabilitiesFromSystemProperties

      protected void transferCapabilitiesFromSystemProperties(org.openqa.selenium.MutableCapabilities currentBrowserCapabilities)
    • convertStringToNearestObjectType

      protected Object convertStringToNearestObjectType(String value)
      Converts String to Boolean\Integer or returns original String.
      Parameters:
      value - string to convert
      Returns:
      string's object representation
    • isInteger

      protected boolean isInteger(String value)
    • isBoolean

      protected boolean isBoolean(String value)
    • majorVersion

      protected int majorVersion(@Nullable String browserVersion)
    • cast

      protected <T> T cast(Object value)