Execute Protractor With Chrome Headless Browser


Execute Protractor With Chrome Headless Browser


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


Before going forward I would highly recommend to you to visit my blog to understand about headless browser its type and it's used.

To use Chrome browser we need to add below arguments in the Configuration file




--headless – Argument to run chrome in headless mode
--disable-gpu – It is required only when you are using chrome 58 or below.
--window-size=800x600 – Setting the browser size to 800X600
(With headless chrome, we cannot change the browser size at run time. So we need to set the size of the browser while initiating the driver itself)

Please refer below code snippet where I have added the above configuration in my Conf.js File and execute code.


Result of above code execution would be like:






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