Class DriverSessionCache

java.lang.Object
dev.comfast.cf.se.infra.DriverSessionCache

public class DriverSessionCache extends Object
Caches WebDriver session to avoid creating new session on each test.

This is useful for debugging, where creating new session and opening given entry in application is expensive.

This class is not thread-safe. Don't use it in parallel tests.

  • Constructor Details

    • DriverSessionCache

      public DriverSessionCache(Supplier<org.openqa.selenium.remote.RemoteWebDriver> newDriverSupplier)
  • Method Details

    • get

      public org.openqa.selenium.remote.RemoteWebDriver get()
      Gets WebDriver instance. If session is cached, it will try to reconnect to it.