Executing Automation Script in FireFox Headless Browser


Executing Automation Script in FireFox Headless Browser

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


Before going forward, I would highly recommend to you to visit my blog to understand about headless browser its type and its use.

To use FireFox browser we need to addCommandLineOptions–headless in our code and use it along with FirefoxBinary.


Please refer below code snippet where I have read the title of google homepage in Firefox headless mode along.

Result of above code execution would be like:



After Reading this the next logical question you would be having how to capture screenshot in Headless Mode. Please refer to 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
August 1, 2019 at 1:21 PM

I get error 'The constructor FirefoxDriver(FirefoxOptions) is undefined'

Reply
avatar