Hi guys, I have noticed that many developers doesn’t know the purpose of the headless browsers and when you can consider to use them. Everything depends of your project and what is the purpose of your tests.
You can use headless browser for:
- Test automation in web applications (Best performance as you don’t have a GUI).
- Taking screenshots of web pages.
- Scraping web sites for data.
- Automating interaction of web pages.
- Perform DDOS attacks on web sites.
- Increase advertisement impressions.
- Automate web sites in unintended ways e.g. for Credential stuffing.
Headless browsers became a known technology back in 2009 when Google revealed it was opened to using one to parse and index AJAX-based websites.
Headless browsers have been known to be used in DDOS attacks, brute-force attacks, and also for falsely increasing ad revenue by faking page loads and user interactions.
Why not to use them:
- The gain in the speed is not that big compared with real browsers, depending of how many tests you have.
- Hard to debug.
- It is not a real browser, so in the end, it is not the same experience your users have.
- Headless browser can have issues of its own that do not show up in other browsers (a bug found using a headless browser like PhantomJS may actually not be a bug).
- Speed vs Consistency.
- More specific code vs more general code.
Hope I have helped you guys to understand when it is possible to use them and when it is not, since it depends of your project and your requirements. You can judge what is the best option for your project in the moment.
Thank you guys, see you later !