fromExistingSessionSync function Null safety
Creates an async WebDriver from existing session with a sync function.
This will be helpful when you can't use async when creating WebDriver. For example in a consctructor.
This is intended for internal use! Please use fromExistingSessionSync from async_io.dart or async_html.dart.
Implementation
WebDriver fromExistingSessionSync(
AsyncRequestClient Function(Uri prefix) createRequestClient,
String sessionId,
WebDriverSpec spec,
{Uri? uri,
Map<String, dynamic>? capabilities}) {
uri ??= defaultUri;
capabilities ??= Capabilities.empty;
if (spec != WebDriverSpec.JsonWire && spec != WebDriverSpec.W3c) {
throw 'Unexpected spec: $spec';
}
return WebDriver(uri, sessionId, UnmodifiableMapView(capabilities),
createRequestClient(uri.resolve('session/$sessionId/')), spec);
}