Interface Browser
-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
public interface Browser implements AutoCloseable
The Browser defines methods and events to manipulate a real browser.
-
-
Method Summary
Modifier and Type Method Description abstract WebDrivernewDriver()Create a new driver. abstract WebDrivernewDriver(String url)Create a new driver. abstract List<WebDriver>listDrivers()List all drivers, each driver is associated with a Chrome tab. abstract WebDriverfindDriver(String url)Find the first driver by url. abstract WebDriverfindDriver(Regex urlRegex)Find the first driver by url regex. abstract List<WebDriver>findDrivers(Regex urlRegex)Find drivers by url regex. abstract UnitdestroyDriver(WebDriver driver)Destroy the web driver, close the associated browser tabs. abstract UnitdestroyForcibly()Destroy the browser forcibly, kill the associated browser processes, release all allocated resources, regardless of whether the browser is closed or not. abstract UnitclearCookies()Clear all cookies. abstract BrowserIdgetId()The unique browser id abstract IntegergetInstanceId()The browser instance id abstract StringgetUserAgent()The user agent. abstract NavigateHistorygetNavigateHistory()The navigation history. abstract Map<String, WebDriver>getDrivers()The created drivers by this browser. abstract Map<String, Object>getData()The associated data. abstract BooleanisActive()Check if this browser is active. abstract BooleanisClosed()Check if this browser is closed. abstract BooleanisConnected()Check if this browser is open. abstract BrowserSettingsgetSettings()The browser settings. BooleangetCanConnect()abstract BooleanisIdle()Check if this browser is idle. abstract BooleanisPermanent()Check if this browser is permanent. abstract StringgetReadableState()The status of this browser. -
-
Method Detail
-
listDrivers
abstract List<WebDriver> listDrivers()
List all drivers, each driver is associated with a Chrome tab.
-
findDriver
abstract WebDriver findDriver(String url)
Find the first driver by url.
-
findDriver
abstract WebDriver findDriver(Regex urlRegex)
Find the first driver by url regex.
-
findDrivers
abstract List<WebDriver> findDrivers(Regex urlRegex)
Find drivers by url regex.
-
destroyDriver
abstract Unit destroyDriver(WebDriver driver)
Destroy the web driver, close the associated browser tabs.
-
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
-
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.
-
getNavigateHistory
abstract NavigateHistory getNavigateHistory()
The navigation history.
-
getDrivers
abstract Map<String, WebDriver> getDrivers()
The created drivers by this browser.
-
isConnected
abstract Boolean isConnected()
Check if this browser is open.
-
getSettings
abstract BrowserSettings getSettings()
The browser settings.
-
getCanConnect
Boolean getCanConnect()
-
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.
-
-
-
-