@Test public void whenBrowserIsCreatedThenCouldBeReused(@Drone @Reusable RemoteWebDriver driver) throws UnableReuseSessionException { driver.navigate().to(SERVER_URL.toString()); new AugmentingEnhancer().deenhance(driver, Reusable.class); ReusableCapabilities reusedCapabilities = serializeDeserialize(ReusedSession.createReusableCapabilities(driver .getCapabilities())); SessionId reusedSessionId = new SessionId(serializeDeserialize(driver.getSessionId().toString())); RemoteWebDriver reusedDriver = ReusableRemoteWebDriver.fromReusedSession(HUB_URL, reusedCapabilities.getDesiredCapabilities(), reusedSessionId); reusedDriver.navigate().to(HUB_URL.toString()); }
public static RemoteWebDriver fromReusedSession(URL remoteAddress, Capabilities desiredCapabilities, SessionId sessionId) throws UnableReuseSessionException { RemoteWebDriver driver = new ReusableRemoteWebDriver(remoteAddress, desiredCapabilities, sessionId); checkReusability(sessionId, driver); return driver; }
ReusableRemoteWebDriver extends RemoteWebDriver { public static RemoteWebDriver fromReusedSession(URL remoteAddress, Capabilities desiredCapabilities, SessionId sessionId) throws UnableReuseSessionException { RemoteWebDriver driver = new ReusableRemoteWebDriver(remoteAddress, desiredCapabilities, sessionId); checkReusability(sessionId, driver); return driver; } }
ReusableRemoteWebDriver extends RemoteWebDriver { public static RemoteWebDriver fromReusedSession(URL remoteAddress, Capabilities desiredCapabilities, SessionId sessionId) throws UnableReuseSessionException { RemoteWebDriver driver = new ReusableRemoteWebDriver(remoteAddress, desiredCapabilities, sessionId); checkReusability(sessionId, driver); return driver; } ReusableRemoteWebDriver(); protected  ReusableRemoteWebDriver(CommandExecutor executor, Capabilities capabilities, SessionId sessionId); protected  ReusableRemoteWebDriver(URL remoteAddress, Capabilities capabilities, SessionId sessionId); }
ReusableRemoteWebDriver extends RemoteWebDriver { public static RemoteWebDriver fromReusedSession(URL remoteAddress, Capabilities desiredCapabilities, SessionId sessionId) throws UnableReuseSessionException { RemoteWebDriver driver = new ReusableRemoteWebDriver(remoteAddress, desiredCapabilities, sessionId); checkReusability(sessionId, driver); return driver; } ReusableRemoteWebDriver(); protected  ReusableRemoteWebDriver(CommandExecutor executor, Capabilities capabilities, SessionId sessionId); protected  ReusableRemoteWebDriver(URL remoteAddress, Capabilities capabilities, SessionId sessionId); static RemoteWebDriver fromRemoteWebDriver(RemoteWebDriver remoteWebDriver); static RemoteWebDriver fromReusedSession(URL remoteAddress, Capabilities desiredCapabilities,
        SessionId sessionId); }
ReusableRemoteWebDriver extends RemoteWebDriver { public static RemoteWebDriver fromReusedSession(URL remoteAddress, Capabilities desiredCapabilities, SessionId sessionId) throws UnableReuseSessionException { RemoteWebDriver driver = new ReusableRemoteWebDriver(remoteAddress, desiredCapabilities, sessionId); checkReusability(sessionId, driver); return driver; } ReusableRemoteWebDriver(); protected  ReusableRemoteWebDriver(CommandExecutor executor, Capabilities capabilities, SessionId sessionId); protected  ReusableRemoteWebDriver(URL remoteAddress, Capabilities capabilities, SessionId sessionId); static RemoteWebDriver fromRemoteWebDriver(RemoteWebDriver remoteWebDriver); static RemoteWebDriver fromReusedSession(URL remoteAddress, Capabilities desiredCapabilities,
        SessionId sessionId);  }