It turned out that most of the work was done already and I just needed few minutes to run Firefox in headless mode. Here
is how I did it.
Getting started - requirements
According to official Mozilla guideyou need Firefox 55+ on
Linux and Firefox 56+ on Windows/Mac.
I’m currently using Windows, so I had to
download Firefox 56 beta first (stable version is 55).
Headless Firefox configuration
My code from last week was almost sufficient. I only needed to add one option (–headless). Configuration is almost
identical as in Chrome.
Demo
As usual, I prepared quick demo for my readers. I run it few times in headless/non-headless mode on my local machine and
didn’t observe any time differences. Still the main benefit of headless testing is ease of use on Unix machines. We
don’t have to install xvfb and other tools related to graphic environment.
Demo is testing that only 5 posts is displayed on my homepage.