Running Automation Script in Chrome Headless with TestNg


Related image

In this blog, we are going to learn how we can execute Selenium Automation Test in Headless mode or browser using Chrome.

Before Going Further let's Understand what is Headless Browser.

As Name Suggest Headless Browser is a browser without any user interface it would execute all our test case like a normal web-browser but we won’t be able to see that execution on our screen.



There are many famous headless driver available in the market like:

Chrome Headless Driver
Firefox Headless Driver
HTML unit Driver
PhantomJs
Ghost Driver
·       
          In this blog, we are going to learn about Chrome Headless Driver.

To use Chrome browser we need to addArguments –headless
in our code.


Please refer below code snippet where I have executed two tests in chrome headless mode along with TestNg.


After executing the Code, Result will be like:




After Reading this the next logical question you would be having how to capture screenshot in Headless Mode. Please Refer this blog for more details.





SHARE THIS

Author:

My Name is Ankur Jain and I am currently working as Automation Test Architect.I am ISTQB Certified Test Manager,Certified UI Path RPA Developer as well as Certified Scrum Master with total 12 years of working experience with lot of big banking clients around the globe.I love to Design Automation Testing Frameworks with Selenium,Appium,Protractor,Cucumber,Rest-Assured, Katalon Studio and currently exploring lot in Dev-OPS as well. I am currently staying in Mumbai, Maharashtra. Please Connect with me through Contact Us page of this website.

Previous Post
Next Post
Anonymous
April 19, 2022 at 10:44 AM

Running Automation Script In Chrome Headless With Testng - Qa Automation >>>>> Download Now

>>>>> Download Full

Running Automation Script In Chrome Headless With Testng - Qa Automation >>>>> Download LINK

>>>>> Download Now

Running Automation Script In Chrome Headless With Testng - Qa Automation >>>>> Download Full

>>>>> Download LINK 5b

Reply
avatar
September 18, 2025 at 11:47 AM

Thanks for sharing such a thoughtful article. QA automation has been a game-changer for many teams I’ve worked with, especially when deadlines are tight. Automating repetitive tests gives developers more space to think creatively and ship features faster. I think the best part is the consistency it brings to the quality of software. Looking forward to more posts like this!

Reply
avatar