Interface WebDriverInfo

All Known Implementing Classes:
ChromeDriverInfo, ChromiumDriverInfo, EdgeDriverInfo, GeckoDriverInfo, InternetExplorerDriverInfo, SafariDriverInfo, SafariTechPreviewDriverInfo

@Beta public interface WebDriverInfo
Describes, in general terms, a webdriver instance. This allows services to query the system at run time and offer instances of particular WebDriver subclasses should they be available.
  • Method Details

    • getDisplayName

      String getDisplayName()
      A human-readable name that describes the browser.
    • getCanonicalCapabilities

      Capabilities getCanonicalCapabilities()
      Describes the smallest set of Capabilities that could be used to create an instance of this WebDriver implementation.

      Note, this set does not need to be exhaustive: the only requirement is that if isAvailable() returns true, the returned Capabilities can be passed to createDriver(Capabilities) and a session will be created.

      The smallest set of Capabilities required to create an instance of this WebDriver implementation.
    • isSupporting

      boolean isSupporting(Capabilities capabilities)
      Whether a call to createDriver(Capabilities) would succeed if given capabilities.
    • isSupportingCdp

      boolean isSupportingCdp()
      Whether the driver has enabled the CDP interface.
    • isSupportingBiDi

      boolean isSupportingBiDi()
      Whether the driver has enabled the BiDi interface.
    • isAvailable

      boolean isAvailable()
      Often, a WebDriver instance needs one or more supporting files or executables to be present (such as a vendor-provided executable which speaks the WebDriver Protocol). This means that even though the driver classes might be present in Java, it would make no sense to attempt to instantiate the driver itself.
      Whether the prerequisites required for this WebDriver are present.
    • isPresent

      boolean isPresent()
      Checks whether the browser driver is already present on the host machine. Different from isAvailable() which uses Selenium Manager to obtain the driver when not present.
      Whether the browser driver is present on the host machine.
    • getMaximumSimultaneousSessions

      int getMaximumSimultaneousSessions()
      Some browsers require all the resources of the current system in order to run (for example, Safari on iOS) and so do not support multiple simultaneous sessions on the same system. Other browsers can create isolated state for each new WebDriver instance.

      The count of simultaneous sessions is typically 1, some multiple of the available number of cores, or Integer.MAX_VALUE if the number is unbounded or no-one cares.

    • createDriver

      Optional<WebDriver> createDriver(Capabilities capabilities) throws SessionNotCreatedException
      Creates a new instance of the WebDriver implementation. The instance must be killed by sending the "quit" command. If the instance cannot be created because isAvailable() is false, then Optional.empty() is returned. Otherwise, an attempt to start the session is made and the result returned.