Class BrowserManager

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final Map<BrowserId, Browser> browsers
      private final ImmutableConfig conf
    • Constructor Summary

      Constructors 
      Constructor Description
      BrowserManager(ImmutableConfig conf)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Map<BrowserId, Browser> getBrowsers() The active browsers
      final ImmutableConfig getConf()
      final Browser launch(BrowserId browserId, BrowserSettings browserSettings, Map<String, Object> capabilities) Launch a browser.
      final Browser findBrowserOrNull(BrowserId browserId) Find an existing browser by id.
      final Boolean isActive(BrowserId browserId) Check if the browser is active.
      final Unit closeBrowser(BrowserId browserId) Close a browser.
      final Unit closeBrowser(Browser browser)
      final Unit destroyBrowserForcibly(BrowserId browserId)
      final Unit closeDriver(WebDriver driver)
      final WebDriver findLeastValuableDriver()
      final Unit closeLeastValuableDriver()
      final Unit destroyZombieBrowsersForcibly() Destroy the zombie browsers forcibly, kill the associated browser processes, release all allocated resources, regardless of whether the browser is closed or not.
      final Unit maintain()
      Unit close()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BrowserManager

        BrowserManager(ImmutableConfig conf)
    • Method Detail

      • getBrowsers

         final Map<BrowserId, Browser> getBrowsers()

        The active browsers

      • getConf

         final ImmutableConfig getConf()
      • launch

         final Browser launch(BrowserId browserId, BrowserSettings browserSettings, Map<String, Object> capabilities)

        Launch a browser. If the browser with the id is already launched, return the existing one.

      • findBrowserOrNull

        @Synchronized() final Browser findBrowserOrNull(BrowserId browserId)

        Find an existing browser by id. If the browser is not found, return null.

        Parameters:
        browserId - The browser id
        Returns:

        The browser or null if not found

      • isActive

         final Boolean isActive(BrowserId browserId)

        Check if the browser is active.

      • closeBrowser

        @Synchronized() final Unit closeBrowser(BrowserId browserId)

        Close a browser.

      • closeBrowser

        @Synchronized() final Unit closeBrowser(Browser browser)
      • closeDriver

        @Synchronized() final Unit closeDriver(WebDriver driver)
      • destroyZombieBrowsersForcibly

        @Synchronized() final Unit destroyZombieBrowsersForcibly()

        Destroy the zombie browsers forcibly, kill the associated browser processes, release all allocated resources, regardless of whether the browser is closed or not.

      • close

        @Synchronized() Unit close()