title: Can't take screenshot in command line with Chrome
body: <p>My final goal is to be able to take automated screenshots. For this I've been reading this <a href="https://developers.google.com/web/updates/2017/04/headless-chrome" rel="nofollow noreferrer">article</a> which says that it should be as simple as this in the command line:</p>
  
  <pre><code>chrome --headless --disable-gpu --screenshot https://www.chromestatus.com/
  </code></pre>
  
  <p>But I don't get any screenshot.png files anywhere in the <em>current directory</em>, in my case C:\temp. I've also tried omitting the 'headless' parameter but the only thing that happens is that Chrome opens the website but no file is created. </p>
  
  <p>The plan is to use chrome and selenium together as such:</p>
  
  <pre><code>public void ScreenshotPage(string url)
  {
      ChromeOptions o = new ChromeOptions();
  
      o.AddArgument("window-size=1920,1200");
      o.AddArgument("disable-gpu");
      o.AddArgument("disable-extensions");
      o.AddArgument("headless");
      o.AddArgument(url);
  
      using (var driver = new ChromeDriver(o))
      {
          //driver.Navigate().GoToUrl(url); // if o.AddArgument(url) doesn't work then try this instead.
          //Thread.Sleep(10000);
          Screenshot screenshot = driver.GetScreenshot();
          screenshot.SaveAsFile(@"C:\temp\test.png", ScreenshotImageFormat.Png);
      }
  }
  </code></pre>
  
  <p>The result is a blank png-file which seems to have the right resolution.</p>
  
  <p>One reason that I'm looking into headless Chrome is that my program is going to be run in a virtual machine and without a user logged in. This creates a problem for ChromeDriver's GetScreenshot() since it will use a very low resolution for taking the screenshot. I was hoping that a headless Chrome would solve this issue.</p>
  
  <p>There doesn't seem to be any relevant information on the Internet, save <a href="https://github.com/schnerd/chrome-headless-screenshots" rel="nofollow noreferrer">Using headless Chrome as an automated screenshot tool (alternative to PhantomJS)</a> where the author has explicitly stated that he is targeting Chrome v60. I'm a bit hesitant using puppeteer since I'm writing in .NET and not so sure if current ports are </p>
  
  <p>Environment: Google Chrome 63.0.3239.132 64-bit, Windows 10 (and Server 2012), Chromedriver 2.34</p>