-
-
Notifications
You must be signed in to change notification settings - Fork 80
Description
This feature adds an initial check of driver state to ensure that it is working. The primary goal of this feature is to handle "no such execution context" WebDriverException
that recently happens with Chrome, rarely, but anyway it happens. So after driver is created we can request some driver property to ensure it doesn't throw exception. This functionality works together with the driver creation retry functionality, which means that in case of health check failure the driver can be recreated and new one checked again.
By default this functionality is disabled. It can be enabled for particular driver(s).
Configuration methods
2 methods were added to the base DriverAtataContextBuilder<TBuilder>
class:
public TBuilder WithInitialHealthCheck(bool enable = true);
public TBuilder WithInitialHealthCheckFunction(Func<IWebDriver, bool> function);
WithInitialHealthCheck
- enables or disables an initial health check. By default it is disabled.
WithInitialHealthCheckFunction
- sets the initial health check function. The default function requests IWebDriver.Url
.
Usage
AtataContext.GlobalConfiguration
.UseChrome()
.WithInitialHealthCheck()
.Build();