Interface Browser

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    
    public interface Browser
     implements AutoCloseable
                        

    The Browser defines methods and events to manipulate a real browser.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract WebDriver newDriver() Create a new driver.
      abstract WebDriver newDriver(String url) Create a new driver.
      abstract List<WebDriver> listDrivers() List all drivers, each driver is associated with a Chrome tab.
      abstract WebDriver findDriver(String url) Find the first driver by url.
      abstract WebDriver findDriver(Regex urlRegex) Find the first driver by url regex.
      abstract List<WebDriver> findDrivers(Regex urlRegex) Find drivers by url regex.
      abstract Unit destroyDriver(WebDriver driver) Destroy the web driver, close the associated browser tabs.
      abstract Unit destroyForcibly() Destroy the browser forcibly, kill the associated browser processes, release all allocated resources, regardless of whether the browser is closed or not.
      abstract Unit clearCookies() Clear all cookies.
      abstract BrowserId getId() The unique browser id
      abstract Integer getInstanceId() The browser instance id
      abstract String getHost()
      abstract Integer getPort()
      abstract String getUserAgent() The user agent.
      abstract NavigateHistory getNavigateHistory() The navigation history.
      abstract Map<String, WebDriver> getDrivers() The created drivers by this browser.
      abstract WebDriver getFrontDriver() The front driver who has called bringToFront()
      abstract Map<String, Object> getData() The associated data.
      abstract Boolean isActive() Check if this browser is active.
      abstract Boolean isClosed() Check if this browser is closed.
      abstract Boolean isConnected() Check if this browser is open.
      abstract BrowserSettings getSettings() The browser settings.
      abstract Boolean isIdle() Check if this browser is idle.
      abstract Boolean isPermanent() Check if this browser is permanent.
      abstract String getReadableState() The status of this browser.
      • Methods inherited from class java.lang.AutoCloseable

        close
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • listDrivers

         abstract List<WebDriver> listDrivers()

        List all drivers, each driver is associated with a Chrome tab.

      • destroyForcibly

         abstract Unit destroyForcibly()

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

      • clearCookies

         abstract Unit clearCookies()

        Clear all cookies. Notice: even if we clear all cookies, the website still has some technology to track a session.

      • getInstanceId

         abstract Integer getInstanceId()

        The browser instance id

      • getHost

         abstract String getHost()
      • getPort

         abstract Integer getPort()
      • getUserAgent

         abstract String getUserAgent()

        The user agent. A user agent is a string that a browser sends to each website you visit. It's created when the browser first connected to the remote browser.

      • getData

         abstract Map<String, Object> getData()

        The associated data.

      • isActive

         abstract Boolean isActive()

        Check if this browser is active.

      • isClosed

         abstract Boolean isClosed()

        Check if this browser is closed.

      • isConnected

         abstract Boolean isConnected()

        Check if this browser is open.

      • getSettings

         abstract BrowserSettings getSettings()

        The browser settings.

      • isIdle

         abstract Boolean isIdle()

        Check if this browser is idle.

      • isPermanent

         abstract Boolean isPermanent()

        Check if this browser is permanent.

        If a browser is permanent:

        • it will not be closed when the browser is idle

        • the user data will be kept after the browser is closed

      • getReadableState

         abstract String getReadableState()

        The status of this browser.