

These developments made it possible to write efficient tests and scripts against the same browsers that people actually use. Firefox followed up with a headless mode later that year. The author of PhantomJS deprecated it, and his impetus for doing so was Google’s announcement of headless Chrome, which was first available in Chrome 59. The landscape changed significantly in 2017. More involved websites also justify more testing, so the main problem with past headless browsers is that they become less usable exactly when you want to use them more heavily.

Yet comprehensive support is an almost impossible task because of how complicated browsers have become. Headless browsers can work well for testing simpler websites, but to test everything that websites can do, they need to emulate full browsers as closely as possible by supporting various web standards. PhantomJS was one of the more popular ones. These browsers do most of the work of full browsers, but they don’t actually render the UI. Eventually, programmers started using headless browsers in some cases. Selenium is also fairly resource-heavy, in part because it has generally been used to run full browsers.

Selenium tests are commonly flaky, failing intermittently for non-obvious reasons that are difficult to reproduce. However, Selenium has a reputation for being unreliable. While its primary use case has been implementing test suites for websites, programmers have also used it for things like taking screenshots or automating tasks when websites don’t provide APIs. Selenium has been around since 2004, and for a long time, it was the go-to tool for this category. It might be helpful to understand some historical context first.īrowser automation is not a new technology. Let’s take a look at what makes each of them interesting and consider the factors that should go into deciding which one to use. Puppeteer is also a Node.js library for browser automation. Playwright is a Node.js library for browser automation.
