title: Selenium ChromeDriver "no such session" error
body: <p>I am using:</p>
  
  <ul>
  <li>chromedriver=2.26.436362</li>
  <li>Chrome Version 55.0.2883.87 m (64-bit)</li>
  <li>.Net C# 4.6.1 / Visual Studio 2015 Community Edition</li>
  </ul>
  
  <p>I am seeing the following exception during website testing (this is my log4net entry):</p>
  
  <pre><code>FATAL2017-01-09 05:03:10 – no such session
    (Driver info: chromedriver=2.26.436362 (5476ec6bf7ccbada1734a0cdec7d570bb042aa30),platform=Windows NT 6.1.7601 SP1 x86_64)
  FATAL2017-01-09 05:03:10 –    at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
     at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
     at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScriptCommand(String script, String commandName, Object[] args)
     at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScript(String script, Object[] args)
  </code></pre>
  
  <p>I start my driver session like this:</p>
  
  <pre><code>        var options = new ChromeOptions();
          options.AddArguments("test-type");          
          options.AddArgument("incognito"); // works
          options.AddArgument("--disable-bundled-ppapi-flash"); // works! this turns off shockwave
          options.AddArgument("--disable-extensions"); // works
          options.AddArguments("--start-fullscreen");
          var driver = new ChromeDriver(options);
          driver.Manage().Cookies.DeleteAllCookies();
          return driver;
  </code></pre>
  
  <p>And I navigate to a "new" tab in Chrome with the following command:</p>
  
  <pre><code>lock (Session.Driver)
  {                
      JavaScriptExecutor jscript = Session.Driver as IJavaScriptExecutor;
      jscript.ExecuteScript(string.Format("window.open('{0}', '_blank');", url));
  }
  </code></pre>
  
  <p>Which works in <code>DEBUG</code> 100% of the time. In <code>RELEASE</code> mode, I receive the error above. Which makes this a difficult problem to resolve...no debugger.</p>
  
  <p>I have checked and the session is active, and at the point of entry two handles in <code>Driver.WindowHandles</code> corresponding to the tabs in Chrome are available. I have resorted to <code>Console.Writeline()</code> statements to view variables that I would normally diagnose in the watch window in visual studio debug mode.</p>
  
  <p>I have been unable to reproduce this exception while debugging. It always "works" during debugging. </p>
  
  <p>There are 5-10 other SO posts about the same issue. The answers to those questions involved updating the chromedriver.exe (I have the latest, and also tried older versions), or, are working with a different technology stack. There must be something else going on here.</p>
  
  <p><strong>Notes:</strong></p>
  
  <ol>
  <li>I can reproduce this error every time in RELEASE mode. However in DEBUG mode it works every time (no error).</li>
  <li>I tried downgrading to chrome32_53.0.2785.116 (I uninstalled version 54) - same results no improvement.</li>
  <li>I checked which chrome driver I'm using for DEBUG: it is exactly the same chromedriver.exe used during RELEASE. (this leads me to conclude that neither Chrome, nor the Chrome driver, are the culprit).</li>
  </ol>