- Potentially less overhead (system resources)
- Much simpler setup (compared to something like Xvfb)
- Better support for actual automation tasks, e.g. screenshots, separate sessions, etc.
The last point is especially relevant if you run a tool that is visiting many sites in parallel. If you run multiple tabs per process to keep memory usage and Xvfb instances limited then you won't be able to have separate browsing sessions, e.g. two concurrent navigations to the same origin could interfere with each other (cookies, local storage, etc). Another obstacle I have discovered is that you can only take screenshots for the tab that is currently active. For my site (https://urlscan.io) I work around that by manually activating the tab when the load event fires to take the screenshot. Works reasonably well, but can sometimes fail under load.
This is a huge flaw in NightmareJS, which is disappointing because of how beautifully simple its API is. A Nightmare fork rebuilt over headless Chrome would be the best of all worlds for browser automation.
Assuming you're running Selenium, this is handled. If you need, you can call each session with its own profile.
xvfb-run -s '-screen 0 1280x1024x8' ./cucumber
I would like to know what sort of performance differential I can expect.