Package com.codeborne.selenide.webdriver
Class AbstractDriverFactory
java.lang.Object
com.codeborne.selenide.webdriver.AbstractDriverFactory
- All Implemented Interfaces:
DriverFactory
- Direct Known Subclasses:
AbstractChromiumDriverFactory,DefaultDriverFactory,FirefoxDriverFactory,HtmlUnitDriverFactory,InternetExplorerDriverFactory,SafariDriverFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> Tprotected ObjectConverts String to Boolean\Integer or returns original String.protected org.openqa.selenium.MutableCapabilitiescreateCommonCapabilities(Config config, Browser browser, @Nullable org.openqa.selenium.Proxy proxy) protected <T extends org.openqa.selenium.MutableCapabilities>
TcreateCommonCapabilities(T capabilities, Config config, Browser browser, @Nullable org.openqa.selenium.Proxy proxy) protected voidfindBinariesWithoutSelenideProxy(@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.protected booleanprotected booleanprotected booleanprotected intmajorVersion(@Nullable String browserVersion) protected <T extends org.openqa.selenium.MutableCapabilities>
Tmerge(T capabilities, org.openqa.selenium.MutableCapabilities additionalCapabilities) protected voidsetTimezone(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.protected @Nullable StringBrowsers silently fall back to UTC for an unknown timezone, so we fail fast on a typo.protected voidtransferCapabilitiesFromSystemProperties(org.openqa.selenium.MutableCapabilities currentBrowserCapabilities) protected FilewebdriverLog(Config config) protected <DS extends org.openqa.selenium.remote.service.DriverService,B extends org.openqa.selenium.remote.service.DriverService.Builder<DS, ?>>
DSMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.codeborne.selenide.webdriver.DriverFactory
create, createCapabilities, setBrowserPosition, setBrowserSize
-
Constructor Details
-
AbstractDriverFactory
public AbstractDriverFactory()
-
-
Method Details
-
webdriverLog
-
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.
-
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
-
createCommonCapabilities
-
timezone
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
TZreads 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
Converts String to Boolean\Integer or returns original String.- Parameters:
value- string to convert- Returns:
- string's object representation
-
isInteger
-
isBoolean
-
majorVersion
-
cast
-