public void AllowPooling() { for (int i = 0; i < BrowserFactories.Count; i++) { BrowserFactories[i] = new PoolingDriverFactory(BrowserFactories[i]); } }
public PoolDriverToken(PoolingDriverFactory pool, IWebDriverToken driver) { driverToken = driver; this.pool = pool; }
public void Dispose() { try { ExpectedConditions.AlertIsPresent()(Driver)?.Dismiss(); Driver.Manage().Cookies.DeleteAllCookies(); Driver.Navigate().GoToUrl("about:blank"); pool.ReturnDriver(driverToken); pool = null; } catch { // ignore, recyclation failed - we'll create new one } }