WebDriver class
- Implemented types
Constructors
Properties
-
activeElement
→ Future<
WebElement?> -
The currently focused element, or the body element if no element has
focus.
no setter
-
capabilities
→ Map<
String, dynamic> -
final
-
no setter
-
currentUrl
→ Future<
String> -
The current url.
no setter
- driver → WebDriver
-
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
final
- keyboard → Keyboard
-
no setter
- logs → Logs
-
logs.get(logType)
will give list of logs captured in browser.no setter - mouse → Mouse
-
no setter
- notifyListeners ↔ bool
-
If true, WebDriver actions are recorded as WebDriverCommandEvents.
getter/setter pair
-
pageSource
→ Future<
String> -
An artist's rendition of the current page's source.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spec → WebDriverSpec
-
final
- stepper ↔ Stepper?
-
getter/setter pair
- switchTo → TargetLocator
-
no setter
- syncDriver → WebDriver
-
Produces a sync_core.WebDriver with the same session ID. Allows
forwards compatibility with other frameworks.
no setter
- timeouts → Timeouts
-
no setter
-
title
→ Future<
String> -
The title of the current page.
no setter
- uri → Uri
-
final
-
window
→ Future<
Window> -
Handle for the active tab/window.
no setter
-
windows
→ Stream<
Window> -
Handles for all of the currently displayed tabs/windows.
no setter
Methods
-
addEventListener(
AsyncWebDriverListener listener) → void - Preferred method for registering listeners. Listeners are expected to return a Future. Use new Future.value() for synchronous listeners.
-
back(
) → Future< void> - Navigates backwards in the browser history, if possible.
-
captureElementScreenshotAsBase64(
WebElement element) → Future< String> - Take a screenshot of the specified element as PNG and return it as base64-encoded string.
-
captureElementScreenshotAsList(
WebElement element) → Future< List< int> > - Take a screenshot of the specified element as PNG as list of uint8.
-
captureScreenshot(
) → Stream< int> - Take a screenshot of the current page as PNG as stream of uint8.
-
captureScreenshotAsBase64(
) → Future< String> - Take a screenshot of the current page as PNG and return it as base64-encoded string.
-
captureScreenshotAsList(
) → Future< List< int> > - Take a screenshot of the current page as PNG as list of uint8.
-
close(
) → Future< void> - Closes the current window.
-
deleteRequest(
String command) → Future -
execute(
String script, List args) → Future - Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. The executed script is assumed to be synchronous and the result of evaluating the script is returned.
-
executeAsync(
String script, List args) → Future - Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. The executed script is assumed to be asynchronous and must signal that is done by invoking the provided callback, which is always provided as the final argument to the function. The value to this callback will be returned to the client.
-
findElement(
By by) → Future< WebElement> -
Search for an element within the entire current page.
Throws NoSuchElementException if a matching element is not found.
override
-
findElements(
By by) → Stream< WebElement> -
Search for multiple elements within the entire current page.
override
-
forward(
) → Future< void> - Navigates forwards in the browser history, if possible.
-
get(
Object url) → Future< void> - Navigates to the specified url
-
getElement(
String elementId, [SearchContext? context, Object? locator, int? index]) → WebElement -
getRequest(
String command) → Future -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
postRequest(
String command, [Object? params]) → Future -
quit(
{bool closeSession = true}) → Future< void> - Quits the browser.
-
refresh(
) → Future< void> - Refreshes the current page.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited