title: System.NullReferenceException while taking screenshots with selenium.WebDriver
body: <p>There is some problem. I'm using webdriver with C#. Here is the code</p>
  
  <pre><code> ITakesScreenshot screenshotDriver = driver as ITakesScreenshot;
   Screenshot screenshot = screenshotDriver.GetScreenshot();
   screenshot.SaveAsFile("c:/Image_23.png", System.Drawing.Imaging.ImageFormat.Jpeg);
  </code></pre>
  
  <p>Then it throws System.NullReferenceException for the line:</p>
  
  <pre><code> Screenshot screenshot = screenshotDriver.GetScreenshot();
  </code></pre>
  
  <p>Where am I mistaken?</p>