public static void RestartIfNeed() { if (++count % 20 == 0) { if (webDriver != null) { webDriver.Quit(); webDriver = null; } } }
public static void SetInstance(WebDriverWrapper webDriverWrapper) { if (webDriver != null) { throw new WebDriverCacheInitializationException( "Cannot set instance when another instance is initialized"); } if (!domainUnloadInitialized) { AppDomain.CurrentDomain.DomainUnload += CurrentDomainOnDomainUnload; domainUnloadInitialized = true; } webDriver = webDriverWrapper; }
public static void DestroyInstance() { webDriver.Quit(); webDriver = null; AppDomain.CurrentDomain.DomainUnload -= CurrentDomainOnDomainUnload; }