Running Chrome in headless mode with Selenium C#

In this post we are going to discuss about running Chrome in headless mode with Selenium C#

Chrome headless

Headless Chrome is a way to run Chrome browser without the actual browser UI being spawned. Essentially its running Chrome without chrome! It brings all modern web platform features provided by Chromium and the Blink rendering engine to the command line and automation testing tool such as Selenium in our case

Where is it useful ?

  • A headless browser is a great tool for automated testing and server environments where you don’t need a visible UI shell.
  • And again its not a completely new technology, since there are other big players in this area such as
    • PhantomJS
    • HTMLUnitDriver

So when is Chrome Headless available ?

  • Chrome Headless is supported from Chrome 59.x and above.
  • The current stable version for Windows 10 is Chrome 60.x
  • ChromeDriver v2.30 and above supports headless mode

What changes should I make in my Existing Selenium test ?

Here is the complete video of the above discussion

 

Thanks for reading the post and watching the video!!!

Please leave your comments and let me know if there is anything I should update in this post.

Thanks,
Karthik KK

3 comments

  1. MZ says:

    Thanks a lot for the post. I tried to follow the same steps, but didn’t work out. I used :
    Chrome Version 59.0.3071.115 (Official Build) (64-bit)
    Windows 10 64 bit
    package id=”Selenium.WebDriver.ChromeDriver” version=”2.31.0″ targetFramework=”net45″ /> this is the same ChromeDriver that you guys mentioned in you video.

    the problem I have is that it does not recognize the IWebDriver and it keeps giving me missing-reference error. I really appreciate you help.

    • Karthik kk says:

      Did you added Selenium reference in your project ?

      Also make sure you have installed Chrome latest version which is 60.x now

      Thanks,
      Karthik KK

  2. Geoff says:

    Have you successfully used the remote debugging port option with selenium C#? I have tried using this option to allow me to debug some issues I’m having with moving my automated tests from PhantomJS to headless Chrome but I get a timeout error when using the remote debugging port as an option

Leave a Reply

Your email address will not be published. Required fields are marked *