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 a driver by url. abstract WebDriverfindDrivers(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 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 BooleanisIdle()Check if this browser is idle. abstract BooleanisPermanent()Check if this browser is permanent. -
-
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 a driver by url.
-
findDrivers
abstract 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.
-
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.
-
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
-
-
-
-