-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumWebDriver.Status
-
Method Summary
Modifier and Type Method Description abstract UnitaddInitScript(String script)Adds a script which would be evaluated in one of the following scenarios:<ul> <li> Whenever the page is navigated. abstract UnitnavigateTo(String url)Returns the main resource response. abstract UnitnavigateTo(NavigateEntry entry)Returns the main resource response. abstract UnitsetTimeouts(BrowserSettings browserSettings)abstract StringcurrentUrl()abstract StringpageSource()abstract Map<String, Object>mainRequestHeaders()abstract List<Map<String, String>>mainRequestCookies()abstract List<Map<String, String>>getCookies()abstract UnitbringToFront()Brings page to front (activates tab). abstract LongwaitForSelector(String selector)Returns when element specified by selector satisfies {@code state} option. abstract LongwaitForSelector(String selector, Long timeoutMillis)Returns when element specified by selector satisfies {@code state} option. abstract LongwaitForSelector(String selector, Duration timeout)abstract LongwaitForNavigation()abstract LongwaitForNavigation(Long timeoutMillis)abstract LongwaitForNavigation(Duration timeout)abstract PointDclickablePoint(String selector)abstract RectDboundingBox(String selector)abstract Booleanexists(String selector)abstract Booleanvisible(String selector)abstract Unittype(String selector, String text)abstract Unitclick(String selector, Integer count)abstract UnitclickMatches(String selector, String pattern, Integer count)abstract UnitclickMatches(String selector, String attrName, String pattern, Integer count)abstract StringclickNthAnchor(Integer n, String rootSelector)abstract UnitscrollTo(String selector)abstract UnitscrollDown(Integer count)abstract UnitscrollUp(Integer count)abstract UnitscrollToTop()abstract UnitscrollToBottom()abstract UnitscrollToMiddle(Float ratio)abstract UnitmouseWheelDown(Integer count, Double deltaX, Double deltaY, Long delayMillis)abstract UnitmouseWheelUp(Integer count, Double deltaX, Double deltaY, Long delayMillis)abstract UnitmoveMouseTo(Double x, Double y)abstract UnitdragAndDrop(String selector, Integer deltaX, Integer deltaY)abstract StringouterHTML(String selector)abstract StringfirstText(String selector)abstract List<String>allTexts(String selector)abstract StringfirstAttr(String selector, String attrName)abstract List<String>allAttrs(String selector, String attrName)abstract Objectevaluate(String expression)abstract ObjectevaluateSilently(String expression)abstract ConnectionnewSession()abstract Connection.ResponseloadResource(String url)abstract StringcaptureScreenshot(String selector)This method scrolls element into view if needed, and then ake a screenshot of the element. abstract StringcaptureScreenshot(RectD rect)abstract UnitstopLoading()Force the page stop all navigations and pending resource fetches. abstract Unitstop()Force the page stop all navigations and releases all resources. abstract Unitterminate()Force the page stop all navigations and releases all resources. abstract Unitquit()Quit the tab, clicking the close button. abstract UnitawaitTermination()abstract Unitfree()abstract UnitstartWork()abstract Unitretire()abstract Unitcancel()abstract IntegergetId()abstract StringgetName()abstract BrowsergetBrowser()BrowserInstanceIdgetBrowserId()abstract NavigateEntrygetNavigateEntry()abstract UnitsetNavigateEntry(NavigateEntry navigateEntry)abstract List<NavigateEntry>getNavigateHistory()abstract BrowserTypegetBrowserType()abstract BooleangetSupportJavascript()abstract BooleangetIsMockedPageSource()abstract AtomicReference<WebDriver.Status>getStatus()abstract InstantgetLastActiveTime()abstract DurationgetIdleTimeout()abstract UnitsetIdleTimeout(Duration idleTimeout)BooleangetIsIdle()abstract DurationgetWaitForTimeout()abstract UnitsetWaitForTimeout(Duration waitForTimeout)abstract BooleangetIsCanceled()abstract BooleangetIsWorking()abstract BooleangetIsQuit()abstract BooleangetIsRetired()abstract BooleangetIsFree()abstract BooleangetIsCrashed()abstract StringgetSessionId()Function1<String, Long>getDelayPolicy()-
-
Method Detail
-
addInitScript
abstract Unit addInitScript(String script)
Adds a script which would be evaluated in one of the following scenarios:
<ul> <li> Whenever the page is navigated.</li> </ul><p> The script is evaluated after the document was created but before any of its scripts were run. This is useful to amend the JavaScript environment, e.g. to seed {@code Math.random}.
-
navigateTo
abstract Unit navigateTo(String url)
Returns the main resource response. In case of multiple redirects, the navigation will resolve with the first non-redirect response.
<p> The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error".- Parameters:
url- URL to navigate page to.
-
navigateTo
abstract Unit navigateTo(NavigateEntry entry)
Returns the main resource response. In case of multiple redirects, the navigation will resolve with the first non-redirect response.
<p> The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error".- Parameters:
entry- NavigateEntry to navigate page to.
-
setTimeouts
abstract Unit setTimeouts(BrowserSettings browserSettings)
-
currentUrl
abstract String currentUrl()
-
pageSource
abstract String pageSource()
-
mainRequestHeaders
abstract Map<String, Object> mainRequestHeaders()
-
mainRequestCookies
abstract List<Map<String, String>> mainRequestCookies()
-
getCookies
abstract List<Map<String, String>> getCookies()
-
bringToFront
abstract Unit bringToFront()
Brings page to front (activates tab).
-
waitForSelector
abstract Long waitForSelector(String selector)
Returns when element specified by selector satisfies {@code state} option.
-
waitForSelector
abstract Long waitForSelector(String selector, Long timeoutMillis)
Returns when element specified by selector satisfies {@code state} option. Returns the time remaining until timeout
-
waitForSelector
abstract Long waitForSelector(String selector, Duration timeout)
-
waitForNavigation
abstract Long waitForNavigation()
-
waitForNavigation
abstract Long waitForNavigation(Long timeoutMillis)
-
waitForNavigation
abstract Long waitForNavigation(Duration timeout)
-
clickablePoint
abstract PointD clickablePoint(String selector)
-
boundingBox
abstract RectD boundingBox(String selector)
-
clickMatches
abstract Unit clickMatches(String selector, String pattern, Integer count)
-
clickMatches
abstract Unit clickMatches(String selector, String attrName, String pattern, Integer count)
-
clickNthAnchor
abstract String clickNthAnchor(Integer n, String rootSelector)
-
scrollDown
abstract Unit scrollDown(Integer count)
-
scrollToTop
abstract Unit scrollToTop()
-
scrollToBottom
abstract Unit scrollToBottom()
-
scrollToMiddle
abstract Unit scrollToMiddle(Float ratio)
-
mouseWheelDown
abstract Unit mouseWheelDown(Integer count, Double deltaX, Double deltaY, Long delayMillis)
-
mouseWheelUp
abstract Unit mouseWheelUp(Integer count, Double deltaX, Double deltaY, Long delayMillis)
-
moveMouseTo
abstract Unit moveMouseTo(Double x, Double y)
-
dragAndDrop
abstract Unit dragAndDrop(String selector, Integer deltaX, Integer deltaY)
-
evaluateSilently
abstract Object evaluateSilently(String expression)
-
newSession
abstract Connection newSession()
-
loadResource
abstract Connection.Response loadResource(String url)
-
captureScreenshot
abstract String captureScreenshot(String selector)
This method scrolls element into view if needed, and then ake a screenshot of the element. If the element is detached from DOM, the method throws an error.
-
captureScreenshot
abstract String captureScreenshot(RectD rect)
-
stopLoading
abstract Unit stopLoading()
Force the page stop all navigations and pending resource fetches.
-
awaitTermination
abstract Unit awaitTermination()
-
getBrowser
abstract Browser getBrowser()
-
getBrowserId
BrowserInstanceId getBrowserId()
-
getNavigateEntry
abstract NavigateEntry getNavigateEntry()
-
setNavigateEntry
abstract Unit setNavigateEntry(NavigateEntry navigateEntry)
-
getNavigateHistory
abstract List<NavigateEntry> getNavigateHistory()
-
getBrowserType
abstract BrowserType getBrowserType()
-
getSupportJavascript
abstract Boolean getSupportJavascript()
-
getIsMockedPageSource
abstract Boolean getIsMockedPageSource()
-
getStatus
abstract AtomicReference<WebDriver.Status> getStatus()
-
getLastActiveTime
abstract Instant getLastActiveTime()
-
getIdleTimeout
abstract Duration getIdleTimeout()
-
setIdleTimeout
abstract Unit setIdleTimeout(Duration idleTimeout)
-
getWaitForTimeout
abstract Duration getWaitForTimeout()
-
setWaitForTimeout
abstract Unit setWaitForTimeout(Duration waitForTimeout)
-
getIsCanceled
abstract Boolean getIsCanceled()
-
getIsWorking
abstract Boolean getIsWorking()
-
getIsRetired
abstract Boolean getIsRetired()
-
getIsCrashed
abstract Boolean getIsCrashed()
-
getSessionId
abstract String getSessionId()
-
getDelayPolicy
Function1<String, Long> getDelayPolicy()
-
-
-
-