fromExistingSessionSync function Null safety

WebDriver fromExistingSessionSync(
  1. String sessionId,
  2. WebDriverSpec spec,
  3. {Uri? uri,
  4. Map<String, dynamic>? capabilities}
)

Creates an async WebDriver from existing session with a sync function using AsyncXhrRequestClient.

The function is sync, so all necessary information (sessionId, spec, capabilities) has to be given. Because otherwise, making a call to WebDriver server will make this function async.

This will bring in dependency on dart:html. Note: WebDriver endpoints will be constructed using resolve against uri. Therefore, if uri does not end with a trailing slash, the last path component will be dropped.

Implementation

core.WebDriver fromExistingSessionSync(String sessionId, WebDriverSpec spec,
        {Uri? uri, Map<String, dynamic>? capabilities}) =>
    core.fromExistingSessionSync(
        (prefix) => AsyncXhrRequestClient(prefix), sessionId, spec,
        uri: uri, capabilities: capabilities);