Skip to content

Add driver initial health check functionality #796

@YevgeniyShunevych

Description

@YevgeniyShunevych

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();

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions