title: Selenium Wait until element is visible issue
body: <p>Got problem with proper method for waiting until element is visible.</p>
  
  <p>Let me describe how page works. Page is loaded, dropdown is shown, but then, there is progress bar appearing (jquery block UI), because data is loaded from db, according to some conditions.</p>
  
  <p>So i used two methods, one for wait for element to be present, then wait to dissapear, but on some occassions (maybe there are loaded in other way, etc.) i got Internet Explorer crash (so no exception by selenium, but crash of IE). Below methods and execution:</p>
  
  <pre><code>public IWebElement WaitForPageElementToLoad(By by, IWebDriver driver, int timeInSeconds)
              {
                  WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(timeInSeconds));
                  wait.Until(ExpectedConditions.ElementIsVisible(by));
                  return driver.FindElement(by);
              }
  
  public void WaitForPageElementToBeRemoved(By by, IWebDriver driver, int timeInSeconds)
              {
                  WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(timeInSeconds));
                  wait.Until&lt;bool&gt;((d) =&gt;
                  {
                      try
                      {
                          IWebElement element = d.FindElement(by);
                          return false;
                      }
                      catch (NoSuchElementException)
                      {
                          return true;
                      }
                  });
              }
  </code></pre>
  
  <p>Execution:</p>
  
  <pre><code>WaitForPageElementToLoad(By.XPath("//div[@class='blockUI blockOverlay']"), ieDriver, 25);
  WaitForPageElementToBeRemoved(By.XPath("//div[@class='blockUI blockOverlay']"), ieDriver, 25);
  WaitForPageElementToLoad(By.Id("clientSelector"), ieDriver, 25);
  </code></pre>
  
  <p>I think webdriver is searching through elements during some work, i do not how to figure that out, to write it properly. Maybe you'll have some hints, etc.</p>