WebDriverForwarder class Null safety

WebDriverForwarder accepts HttpRequests corresponding to a variation on the WebDriver wire protocol and forwards them to a WebDriver instance.

The primary difference between this and the standard wire protocol is in the use of WebElement ids. When you need to refer to an element in a request (URI or JSON body), then you should add an 'wd-element-id' attribute to the corresponding element with a unique identifier, and use that identifier as the element id for that element. This class will then search for the corresponding element and in the document and will substitute an actual WebElement id for the given identifier in the request.

This forwarder supports two additional commands that control how it searches for elements: POST '/enabledeep': enables searching through all Shadow DOMs in the document for the corresponding element (but will fail on browsers that don't support the '/deep/' css selector combinator). POST '/disabledeep': disables searching in Shadow DOMs of the document.

This forwarder also supports two additional commands for grabbing the browser contents and saving it to the file system. POST '/screenshot': takes a 'file' arg and will capture a screenshot of the browser and save it to the specified file name in outputDir. POST '/source': takes a 'file' arg and will capture the current page's source and save it to the specified file name in outputDir.

See https://code.google.com/p/selenium/wiki/JsonWireProtocol for documentation of other commands.


WebDriverForwarder(WebDriver driver, {Pattern prefix: '/webdriver', Directory outputDir, bool useDeep: false})


driver WebDriver
WebDriver instance to forward commands to.
hashCode int
The hash code for this object. [...]
read-only, inherited
outputDir Directory
Directory to save screenshots and page source to.
prefix Pattern
Path prefix that all forwarded commands will have.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
useDeep bool
Search for elements in all shadow doms of the current document.
read / write


forward(HttpRequest request) Future<void>
Forward request to driver and respond to the request with the returned value or any thrown exceptions.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toString() String
Returns a string representation of this object.


operator ==(Object other) bool
The equality operator. [...]