title: Chromedriver Not Loading Page in Selenium Tests
body: <p>I’m experiencing an exception scenario using chromedriver.exe with some unit tests that I am writing with the help of Selenium. When the first test that uses the chromedriver executes, the browser fires up and the test passes.</p>
  
  <p>However, for all the following tests that use the chromedriver, the browser does not successfully navigate to the URL.</p>
  
  <p>The browser fires up, momentarily the characters <strong>data;</strong> appear in the address bar (as it did in the first test that worked), then the correct URL is inserted into the address bar. However, the page never loads and you get the standard chrome <strong>This webpage is not available</strong> message in the body/canvas of the browser with the two buttons <strong>reload</strong> and <strong>more</strong>.</p>
  
  <p>Is this a known issue?</p>
  
  <p>I am using the following versions:  </p>
  
  <p>Selenium: 2.41.0.0<br>
  Chromedriver.exe: 2.9.0.0<br>
  Visual Studio 2013: 12.0.30110.00 Update 1    </p>
  
  <p>I have the following <strong>Initialize</strong> method in my <strong>ChromeTestDriver</strong> class which gets invoked in the Setup method (aka TestInitialize) for all tests:</p>
  
  <pre><code>ChromeDriverService chromeDriverService = ChromeDriverService.CreateDefaultService(DriverPath);
  var chromeOptions = new ChromeOptions();
  
  chromeDriverService.Port = DriverPort; // 9999 - this is the port for the driver, not the webpage 
  
  webDriver = new ChromeDriver(chromeDriverService, chromeOptions);
  webDriver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10));
  webDriver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(10)); 
  </code></pre>
  
  <p>I have the following code in the Cleanup method (aka Teardown) for all tests: </p>
  
  <pre><code>TestDriver.CloseWindow();  
  TestDriver.Quit();
  </code></pre>
  
  <p>The following exception gets chucked:  </p>
  
  <blockquote>
    <p>OpenQA.Selenium.NoSuchWindowException: no such window: target window already closed</p>
  </blockquote>
  
  <p>Let me know if I can provide more info.</p>
  
  <p><strong>Edit</strong>
  I've observed that an IE test has to run first before Chrome fails. Generally, the following happens. A Chrome test runs fine. Then an IE test runs. Subsequent to that, all Chrome tests fail. </p>
  
  <p><strong>Further Edit</strong>
  Another unusual aspect to this is that once chrome has been sullied by Selenium for the website, I can no longer load the website in Chrome at all. That is, if I manually type in the URL in Chrome’s address bar, the same empty page is displayed. </p>
  
  <p>Even weirder again, if I run up Fiddler2 (which is basically a proxy), Chrome becomes unsullied. It works again. </p>
  
  <p>I’m confident proxies aren’t the issue as my system has no proxy and the same result occurs when Fiddler2 has been uninstalled from my system. </p>
  
  <p>The symptoms are also reproducible by my client who is located on a different continent. We collaborate using GIT. So it is not confined to my system.</p>
  
  <p>A user on the Selenium Google users group suggested reproducing the bug using the webdriver in a really simple scenario (i.e. not as part of a testing framework). Here is the code for the console app which I created to do that:</p>
  
  <pre><code>private static string Url = "http://localhost:5556";
  
  static void Main(string[] args)
  {
      var chromeWebDriver = GetChromeWebDriver();
      var nav = chromeWebDriver.Navigate();
      nav.GoToUrl(Url);
      Thread.Sleep(3000);
      chromeWebDriver.Quit();
      chromeWebDriver.Dispose();
  
      var iedriver = GetIeDriver();
      var nav1 = iedriver.Navigate();
      nav1.GoToUrl(Url);
      iedriver.Quit();
      iedriver.Dispose();
  
      var chromeWebDriver2 = GetChromeWebDriver();
      var nav2 = chromeWebDriver2.Navigate();
      nav2.GoToUrl(Url);
      chromeWebDriver2.FindElement(By.LinkText("Login")).Click();
  
      System.Threading.Thread.Sleep(2000);
  
      chromeWebDriver2.Quit();
      chromeWebDriver2.Dispose();
  
      Console.ReadLine();
  }
  
  private static IWebDriver GetIeDriver()
  {
      InternetExplorerDriverService internetExplorerDriverService =
          InternetExplorerDriverService.CreateDefaultService(
              @"H:\BW\packages\Selenium.WebDriver.IEDriver.2.41.0.1\content");
      InternetExplorerOptions internetExplorerOptions = new InternetExplorerOptions();
      internetExplorerDriverService.Port = 9999;
      IWebDriver webdriver = new InternetExplorerDriver(internetExplorerDriverService, internetExplorerOptions);
      return webdriver;
  }
  
  private static IWebDriver GetChromeWebDriver()
  {
      var chromeDriverService =
          ChromeDriverService.CreateDefaultService(
              @"H:\BW\packages\Selenium.WebDriver.ChromeDriver.2.10.0.0\content");
      var chromeOptions = new ChromeOptions();
      chromeDriverService.Port = 7777;
      IWebDriver chromeWebDriver = new ChromeDriver(chromeDriverService, chromeOptions);
      return chromeWebDriver;
  }
  </code></pre>