title: webdriver not able to click pop up window with certificate error page
body: <p>Using webdriver 2.40.0 (installed from nugget packages) and writing code in C# I am 
  -   opening a link for my company website which generates a certificate error page
  -   clicking the override link element to allow me to continue to the site
  -   clicking an enter button on that page which generates a pop up window that also had a certificate error page on top of it
  My problem is when I try to select the pop up window a “noSuchWindowException” is thrown, code:</p>
  
  <pre><code>namespace webDriverDemo
  {
      class Program
      {
          static void Main(string[] args)
          {
              string setURL = "xxxxx";
  
              IWebDriver driver = new InternetExplorerDriver(@"C:\Drivers");
              driver.Url = setURL;
              String loginPage = driver.CurrentWindowHandle;
  
              var securityLine = driver.FindElement(By.Id("overridelink"));
              if (!securityLine.Equals(null))
              {
                  securityLine.Click();
              }
  
              var enterBtn = driver.FindElement(By.Id("EnterButton"));
              enterBtn.Click();
  
              //Select the pop up window
  
  
              driver.Navigate().GoToUrl("javascript:document.getElementById('overridelink').click()");
  
              driver.SwitchTo().Window("xxxx");
  </code></pre>
  
  <p>I’ve tried:</p>
  
  <p><code>driver.Navigate().GoToUrl("javascript:document.getElementById('overridelink').click()")</code></p>
  
  <p>and</p>
  
  <p><code>String riskPage = driver.CurrentWindowHandle;</code></p>
  
  <p>and switching to that window, I’ve also tried </p>
  
  <p><code>driver.SwitchTo().Window();</code></p>
  
  <p>but I think the problem is that I can’t get to the window name of the certificate error page and cannot select and element on that page and try to save it as a separate handle. Really need help!</p>