Class ReusableRemoteWebDriver

  • All Implemented Interfaces:
    org.openqa.selenium.federatedcredentialmanagement.HasFederatedCredentialManagement, org.openqa.selenium.HasCapabilities, org.openqa.selenium.HasDownloads, org.openqa.selenium.interactions.Interactive, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.PrintsPage, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator, org.openqa.selenium.WebDriver

    public class ReusableRemoteWebDriver
    extends org.openqa.selenium.remote.RemoteWebDriver
    Reusable remote driver provides same functionality like RemoteWebDriver, but it additionally allows to reuse browser session.

    Provides reusing of RemoteWebDriver session by allowing to setup SessionId from previous session.

    Author:
    Lukas Fryc
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.openqa.selenium.remote.RemoteWebDriver

        org.openqa.selenium.remote.RemoteWebDriver.RemoteTargetLocator, org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriverOptions, org.openqa.selenium.remote.RemoteWebDriver.When
      • Nested classes/interfaces inherited from interface org.openqa.selenium.HasDownloads

        org.openqa.selenium.HasDownloads.DownloadedFile
      • Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver

        org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window
    • Field Summary

      • Fields inherited from class org.openqa.selenium.remote.RemoteWebDriver

        capabilities
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        ReusableRemoteWebDriver()  
      protected ReusableRemoteWebDriver​(URL remoteAddress, org.openqa.selenium.Capabilities capabilities, org.openqa.selenium.remote.SessionId sessionId)  
      protected ReusableRemoteWebDriver​(org.openqa.selenium.remote.CommandExecutor executor, org.openqa.selenium.Capabilities capabilities, org.openqa.selenium.remote.SessionId sessionId)  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.openqa.selenium.remote.RemoteWebDriver fromRemoteWebDriver​(org.openqa.selenium.remote.RemoteWebDriver remoteWebDriver)
      Creates the ReusableRemoteWebDriver from valid RemoteWebDriver instance.
      static org.openqa.selenium.remote.RemoteWebDriver fromReusedSession​(URL remoteAddress, org.openqa.selenium.Capabilities capabilities, org.openqa.selenium.remote.SessionId sessionId)
      Reuses browser session using sessionId and capabilities as fully-initialized Capabilities object from the previous RemoteWebDriver session.
      • Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver

        addVirtualAuthenticator, builder, close, deleteDownloadableFiles, downloadFile, execute, execute, execute, executeAsyncScript, executeScript, findElement, findElements, findElements, fireSessionEvent, fireSessionEvent, get, getCapabilities, getClientConfig, getCommandExecutor, getCurrentUrl, getDownloadableFiles, getDownloadedFiles, getElementConverter, getErrorHandler, getExecuteMethod, getFederatedCredentialManagementDialog, getFileDetector, getPageSource, getScreenshotAs, getSessionId, getTitle, getWindowHandle, getWindowHandles, isDownloadsEnabled, log, manage, navigate, network, perform, print, quit, removeVirtualAuthenticator, resetCooldown, resetInputState, script, setCommandExecutor, setDelayEnabled, setElementConverter, setErrorHandler, setFileDetector, setFoundBy, setLogLevel, setSessionId, startSession, switchTo, toString
      • Methods inherited from interface org.openqa.selenium.HasDownloads

        requireDownloadsEnabled
      • Methods inherited from interface org.openqa.selenium.JavascriptExecutor

        executeScript, getPinnedScripts, pin, unpin
    • Constructor Detail

      • ReusableRemoteWebDriver

        public ReusableRemoteWebDriver()
      • ReusableRemoteWebDriver

        protected ReusableRemoteWebDriver​(org.openqa.selenium.remote.CommandExecutor executor,
                                          org.openqa.selenium.Capabilities capabilities,
                                          org.openqa.selenium.remote.SessionId sessionId)
      • ReusableRemoteWebDriver

        protected ReusableRemoteWebDriver​(URL remoteAddress,
                                          org.openqa.selenium.Capabilities capabilities,
                                          org.openqa.selenium.remote.SessionId sessionId)
    • Method Detail

      • fromRemoteWebDriver

        public static org.openqa.selenium.remote.RemoteWebDriver fromRemoteWebDriver​(org.openqa.selenium.remote.RemoteWebDriver remoteWebDriver)
        Creates the ReusableRemoteWebDriver from valid RemoteWebDriver instance.
        Parameters:
        remoteWebDriver - valid RemoteWebDriver instance.
        Returns:
        the RemoteWebDriver wrapped as ReusableRemoteWebDriver
      • fromReusedSession

        public static org.openqa.selenium.remote.RemoteWebDriver fromReusedSession​(URL remoteAddress,
                                                                                   org.openqa.selenium.Capabilities capabilities,
                                                                                   org.openqa.selenium.remote.SessionId sessionId)
                                                                            throws UnableReuseSessionException
        Reuses browser session using sessionId and capabilities as fully-initialized Capabilities object from the previous RemoteWebDriver session.
        Parameters:
        remoteAddress - address of the remote Selenium Server hub
        capabilities - fully-initialized capabilities returned from previous RemoteWebDriver session
        sessionId - sessionId from previous RemoteWebDriver session
        Throws:
        UnableReuseSessionException