Example #1
0
 public static void RestartIfNeed()
 {
     if (++count % 20 == 0)
     {
         if (webDriver != null)
         {
             webDriver.Quit();
             webDriver = null;
         }
     }
 }
Example #2
0
 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;
 }
Example #3
0
 public static void DestroyInstance()
 {
     webDriver.Quit();
     webDriver = null;
     AppDomain.CurrentDomain.DomainUnload -= CurrentDomainOnDomainUnload;
 }