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