Package io.github.bonigarcia.wdm
Class WebDriverManager
java.lang.Object
io.github.bonigarcia.wdm.WebDriverManager
- Direct Known Subclasses:
ChromeDriverManager,EdgeDriverManager,FirefoxDriverManager,InternetExplorerDriverManager,OperaDriverManager,VoidDriverManager
Parent driver manager.
- Since:
- 2.1.0
- Author:
- Boni Garcia
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected CacheHandlerprotected org.openqa.selenium.Capabilitiesprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected Configprotected static final Stringprotected booleanprotected booleanprotected booleanprotected DockerServiceprotected Stringprotected Stringprotected Downloaderprotected HttpClientprotected static final Stringprotected booleanprotected static final Stringprotected static final org.slf4j.Loggerprotected ResolutionCacheprotected Stringprotected intprotected static final NamespaceContextprotected booleanprotected static final Stringprotected VersionDetectorprotected booleanprotected WebDriverCreatorprotected List<WebDriverBrowser> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddDefaultArgumentsForDocker(org.openqa.selenium.Capabilities options) protected voidarch32()arch64()architecture(Architecture architecture) arm64()browserBinary(String browserBinary) browserVersion(String browserVersion) browserVersionDetectionCommand(String browserVersionCommand) capabilities(org.openqa.selenium.Capabilities capabilities) protected voidprotected booleanstatic WebDriverManagerstatic WebDriverManagercommandsPropertiesUrl(URL url) config()org.openqa.selenium.WebDrivercreate()List<org.openqa.selenium.WebDriver>create(int numberOfBrowser) protected org.openqa.selenium.WebDriverprotected org.openqa.selenium.WebDriverprotected UrlHandlercreateUrlHandler(String driverVersion) dockerCustomImage(String dockerImage) dockerDaemonUrl(String daemonUrl) dockerDefaultArgs(String defaultArgs) dockerEnvVariables(String... defaultEnvs) dockerExtraHosts(String... hosts) dockerLang(String lang) dockerNetwork(String network) dockerPrivateEndpoint(String endpoint) dockerRecordingOutput(String path) dockerRecordingOutput(Path path) dockerRecordingPrefix(String prefix) dockerScreenResolution(String screenResolution) dockerShmSize(String size) dockerStopTimeoutSec(Integer timeout) dockerTimezone(String timezone) dockerTmpfsMount(String mount) dockerTmpfsSize(String size) dockerVolumes(String... volumes) protected StringdriverRepositoryUrl(URL url) driverVersion(String driverVersion) static WebDriverManagerprotected voidexportDriver(String variableValue) exportParameter(DriverManagerType driverManagerType) abstract WebDriverManagerexportParameter(String exportParameter) protected voidprotected Optional<WebDriverBrowser>findWebDriverBrowser(org.openqa.selenium.WebDriver driver) static WebDriverManagerprotected abstract Stringprotected abstract Stringprotected Pathprotected Stringprotected org.openqa.selenium.Capabilitiesprotected StringgetCurrentVersion(URL url) getDockerBrowserContainerId(org.openqa.selenium.WebDriver driver) getDockerNoVncUrl(org.openqa.selenium.WebDriver driver) getDockerRecordingPath(org.openqa.selenium.WebDriver driver) getDockerSeleniumServerUrl(org.openqa.selenium.WebDriver driver) getDockerVncUrl(org.openqa.selenium.WebDriver driver) protected static WebDriverManagerabstract DriverManagerTypeprotected abstract StringgetDriversFromGitHub(String driverVersion) getDriversFromMirror(URL driverUrl, String driverVersion) protected abstract URLprotected URLgetDriverUrls(String driverVersion) protected abstract StringgetDriverVersionFromRepository(Optional<String> driverVersion) protected StringgetDriverVersionLabel(String driverVersion) protected FilenameFilterprotected HttpClientstatic WebDriverManagerstatic WebDriverManagergetInstance(DriverManagerType driverManagerType) static WebDriverManagergetInstance(Class<? extends org.openqa.selenium.WebDriver> webDriverClass) static WebDriverManagergetInstance(String browserName) protected Stringprotected StringgetLogs()getLogs(org.openqa.selenium.WebDriver driver) protected org.openqa.selenium.Capabilitiesprotected NamespaceContextprotected Objectprotected ObjectgetPropertyFromWebDriverBrowser(org.openqa.selenium.WebDriver driver, Function<WebDriverBrowser, Object> function) getRecordingPath(org.openqa.selenium.WebDriver driver) protected ResolutionCacheprotected Optional<NamespaceContext>protected StringgetValueFromResolutionCache(String preferenceKey) protected Charsetprotected VersionDetectororg.openqa.selenium.WebDriverprotected WebDriverCreatorList<org.openqa.selenium.WebDriver>gitHubToken(String gitHubToken) protected voidhandleException(Exception e, String driverVersion) static WebDriverManageriedriver()ignoreDriverVersions(String... driverVersions) protected voidinitBrowserWatcherForChromium(Path extensionPath, org.openqa.selenium.Capabilities caps) protected org.openqa.selenium.WebDriverprotected booleanisChrome()static booleanstatic booleanstatic booleanprotected booleanprotected booleanlinux()static DocumentloadXML(InputStream inputStream) protected static voidlogCliError(String browserForResolving, String browserForDocker, int port) protected voidlogSeekRepo(URL driverUrl) mac()static voidprotected voidprotected InputStreamopenGitHubConnection(URL driverUrl) static WebDriverManagerpostDownload(File archive) properties(String properties) voidquit()protected voidquit(WebDriverBrowser driverBrowser) voidquit(org.openqa.selenium.WebDriver driver) remoteAddress(String remoteAddress) remoteAddress(URL remoteAddress) voidreset()resolutionCachePath(String resolutionCachePath) protected StringresolveDriverVersion(String driverVersion) protected static voidresolveLocal(String[] args, String validBrowsers) protected static voidrunInDocker(String[] args, String validBrowsers) static WebDriverManagerprotected abstract voidsetBrowserBinary(String browserBinary) protected abstract voidsetBrowserVersion(String browserVersion) protected abstract voidsetDriverUrl(URL url) protected abstract voidsetDriverVersion(String driverVersion) voidsetup()voidvoidstartRecording(String recordingName) voidstartRecording(org.openqa.selenium.WebDriver driver) voidstartRecording(org.openqa.selenium.WebDriver driver, String recordingName) protected static voidstartServer(String[] args, int port) voidprotected voidstopDockerRecording(WebDriverBrowser driverBrowser) voidstopDockerRecording(org.openqa.selenium.WebDriver driver) voidvoidstopRecording(org.openqa.selenium.WebDriver driver) protected voidstoreInResolutionCache(String preferenceKey, String resolvedDriverVersion, String resolvedBrowserVersion) timeout(int timeout) ttl(int seconds) ttlBrowsers(int seconds) protected booleanprotected booleanviewOnly()protected static WebDriverManagerwatch()win()static Path
-
Field Details
-
log
protected static final org.slf4j.Logger log -
SLASH
- See Also:
-
DASH
- See Also:
-
LATEST_RELEASE
- See Also:
-
CFT_LABEL
- See Also:
-
S3_NAMESPACE_CONTEXT
-
IN_DOCKER
- See Also:
-
CLI_SERVER
- See Also:
-
CLI_RESOLVER
- See Also:
-
CLI_DOCKER
- See Also:
-
BROWSER_WATCHER_ID
- See Also:
-
config
-
httpClient
-
downloader
-
resolutionCache
-
cacheHandler
-
versionDetector
-
webDriverCreator
-
dockerService
-
retryCount
protected int retryCount -
capabilities
protected org.openqa.selenium.Capabilities capabilities -
shutdownHook
protected boolean shutdownHook -
dockerEnabled
protected boolean dockerEnabled -
watchEnabled
protected boolean watchEnabled -
displayEnabled
protected boolean displayEnabled -
disableCsp
protected boolean disableCsp -
isHeadless
protected boolean isHeadless -
webDriverList
-
resolvedBrowserVersion
-
downloadedDriverVersion
-
downloadedDriverPath
-
-
Constructor Details
-
WebDriverManager
protected WebDriverManager()
-
-
Method Details
-
getDriverUrls
- Throws:
IOException
-
getDriverName
-
getDriverVersion
-
setDriverVersion
-
getBrowserVersion
-
setBrowserVersion
-
getBrowserBinary
-
setBrowserBinary
-
setDriverUrl
-
getDriverUrl
-
getMirrorUrl
-
getExportParameter
-
getDriverManagerType
-
exportParameter
-
config
-
chromedriver
-
chromiumdriver
-
firefoxdriver
-
operadriver
-
edgedriver
-
iedriver
-
safaridriver
-
voiddriver
-
getInstance
-
getInstance
-
getInstance
public static WebDriverManager getInstance(Class<? extends org.openqa.selenium.WebDriver> webDriverClass) -
getDriver
-
getInstance
-
zipFolder
-
isDockerAvailable
public static boolean isDockerAvailable() -
isOnline
-
isOnline
-
setup
public void setup() -
create
public org.openqa.selenium.WebDriver create() -
create
-
getBrowserPath
-
browserInDocker
-
isUsingDocker
protected boolean isUsingDocker() -
dockerEnvVariables
-
dockerDefaultArgs
-
dockerDaemonUrl
-
dockerNetwork
-
dockerNetworkHost
-
dockerTimezone
-
dockerLang
-
dockerShmSize
-
dockerTmpfsSize
-
dockerTmpfsMount
-
dockerVolumes
-
dockerExtraHosts
-
dockerScreenResolution
-
dockerAvoidPulling
-
avoidDockerLocalFallback
-
avoidShutdownHook
-
avoidExternalConnections
-
enableVnc
-
viewOnly
-
enableRecording
-
disableTracing
-
dockerRecordingPrefix
-
dockerRecordingOutput
-
dockerRecordingOutput
-
dockerPrivateEndpoint
-
dockerStopTimeoutSec
-
watch
-
watchAndDisplay
-
disableCsp
-
checkBrowserWatcherVersion
protected void checkBrowserWatcherVersion() -
capabilities
-
remoteAddress
-
remoteAddress
-
dockerCustomImage
-
driverVersion
-
browserVersion
-
browserBinary
-
architecture
-
arch32
-
arch64
-
arm64
-
win
-
linux
-
mac
-
operatingSystem
-
forceDownload
-
driverRepositoryUrl
-
useMirror
-
proxy
-
proxyUser
-
proxyPass
-
useBetaVersions
-
ignoreDriverVersions
-
gitHubToken
-
timeout
-
properties
-
cachePath
-
resolutionCachePath
-
avoidExport
-
avoidOutputTree
-
avoidBrowserDetection
-
avoidResolutionCache
-
avoidFallback
-
avoidTmpFolder
-
avoidUseChromiumDriverSnap
-
avoidUseGeckoDriverSnap
-
ttl
-
ttlBrowsers
-
browserVersionDetectionCommand
-
useLocalCommandsPropertiesFirst
-
commandsPropertiesUrl
-
clearResolutionCache
-
clearDriverCache
-
reset
public void reset() -
getDownloadedDriverPath
-
getDownloadedDriverVersion
-
getDriverVersions
-
getWebDriver
public org.openqa.selenium.WebDriver getWebDriver() -
getWebDriverList
-
quit
public void quit() -
quit
public void quit(org.openqa.selenium.WebDriver driver) -
stopDockerRecording
public void stopDockerRecording() -
stopDockerRecording
public void stopDockerRecording(org.openqa.selenium.WebDriver driver) -
stopDockerRecording
-
quit
-
getDockerBrowserContainerId
-
getDockerBrowserContainerId
-
getDockerSeleniumServerUrl
-
getDockerSeleniumServerUrl
-
getDockerNoVncUrl
-
getDockerNoVncUrl
-
getDockerVncUrl
-
getDockerVncUrl
-
getDockerRecordingPath
-
getDockerRecordingPath
-
startRecording
public void startRecording(org.openqa.selenium.WebDriver driver) -
startRecording
public void startRecording() -
startRecording
-
startRecording
-
stopRecording
public void stopRecording(org.openqa.selenium.WebDriver driver) -
stopRecording
public void stopRecording() -
getRecordingPath
-
getRecordingPath
-
getLogs
-
getLogs
-
getDockerService
-
exportParameter
-
getPropertyFromWebDriverBrowser
protected Object getPropertyFromWebDriverBrowser(org.openqa.selenium.WebDriver driver, Function<WebDriverBrowser, Object> function) -
findWebDriverBrowser
-
getPropertyFromFirstWebDriverBrowser
-
manage
-
checkSnap
-
resolveDriverVersion
-
download
- Throws:
IOException
-
exportDriver
-
storeInResolutionCache
-
getValueFromResolutionCache
-
postDownload
-
getBrowserVersionFromTheShell
-
detectBrowserVersion
-
useResolutionCacheWithKey
-
useResolutionCache
protected boolean useResolutionCache() -
isUseMirror
protected boolean isUseMirror() -
isChrome
protected boolean isChrome() -
getCurrentVersion
-
handleException
-
fallback
-
createUrlHandler
- Throws:
IOException
-
getDriversFromMirror
- Throws:
IOException
-
getNamespaceContext
-
getS3NamespaceContext
-
logSeekRepo
-
loadXML
public static Document loadXML(InputStream inputStream) throws SAXException, IOException, ParserConfigurationException -
openGitHubConnection
- Throws:
IOException
-
getDriversFromGitHub
- Throws:
IOException
-
getHttpClient
-
getResolutionCache
-
getVersionDetector
-
getWebDriverCreator
-
getFolderFilter
-
getVersionCharset
-
getLatestVersionLabel
-
getOsLabel
-
getDriverVersionFromRepository
-
getDriverUrlCkeckingMirror
-
getLatestDriverVersionFromRepository
-
getShortDriverName
-
getKeyForResolutionCache
-
getDriverVersionLabel
-
buildUrl
-
instantiateDriver
protected org.openqa.selenium.WebDriver instantiateDriver() -
initBrowserWatcherForChromium
protected void initBrowserWatcherForChromium(Path extensionPath, org.openqa.selenium.Capabilities caps) -
getBrowserWatcherAsPath
- Throws:
IOException
-
getBrowserWatcherVersion
-
getMergedCapabilities
protected org.openqa.selenium.Capabilities getMergedCapabilities() -
addShutdownHookIfRequired
protected void addShutdownHookIfRequired() -
createDockerWebDriver
protected org.openqa.selenium.WebDriver createDockerWebDriver() -
createLocalWebDriver
protected org.openqa.selenium.WebDriver createLocalWebDriver() throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException -
getCapabilities
protected org.openqa.selenium.Capabilities getCapabilities() -
addDefaultArgumentsForDocker
protected void addDefaultArgumentsForDocker(org.openqa.selenium.Capabilities options) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException -
logCliError
-
resolveLocal
-
runInDocker
-
startServer
-
main
-