BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Google Releases Puppeteer 1.0

Google Releases Puppeteer 1.0

This item in japanese

Puppeteer 1.0 has been released and includes dozens of improvements, including measurement of JavaScript heap and page performance, and code coverage information for JavaScript and CSS.

Puppeteer is a headless automation tool and API for Chrome and Chromium-based web browsers. Leveraging Node.js and the Chrome DevTools protocol, Puppeteer provides an alternative to Selenium WebDriver.

Beyond the typical use case of automated browser testing, Puppeteer can be used for a variety of browser automation techniques including performing repetitive tasks, scraping content, and screenshot generation. Puppeteer requires at least Node.js version 6.4, though to use many of the more modern ES2015+ APIs such as async/await, users should start with Node.js version 8.x or greater.

The project provides the hosted Try Puppeteer app as a way to quickly get started with Puppeteer.

Since its initial release, Puppeteer has been widely adopted as a simpler way to introduce automation into the developer workflow. Many developers have authored extensive tutorials and provided their feedback on working with Puppeteer.

Valentino Gagliardi, a JavaScript and React consultant, remarks in his tutorial on using Puppeteer with Jest:

Puppeteer gives you endless possibilities. A lot of folks are building new testing frameworks right now, with Puppeteer. The API could be improved, sure, but knowing the basics is a must.

Gergely Nemeth, a Node.js expert, cites the simplicity of setting up Puppeteer compared to Selenium-based tools:

However, to run Selenium tests, you need a Selenium server/cluster running locally or in the cloud, and also browser drivers to control Chrome, Firefox or any other browser. This simply has too many components, and hard to get right. Debugging tests written for Selenium can also be challenging - even simple things like grabbing the console output from test cases, slowing down tests so you can see what’s going on or intercepting requests.

Not everyone is convinced that Puppeteer is a step in the right direction. Oren Rubin, CEO at Testim.io, a machine learning test automation platform, asks if Puppeteer helps the development community or not, and points out that:

The awesomeness of Selenium is that they convinced ALL browser vendors to support the same low level API (and this took years! try convincing Apple, MS, and Google to work together), and even implemented this API in more than 10 languages (including JS).

Puppeteer's biggest limitation is that it only supports testing Chrome and Chromium-based browsers, so a Selenium-based solution is needed for automated cross-browser testing. A number of testing tools can reduce the installation challenges with Selenium driver installation, simplifying the testing and configuration process.

Rate this Article

Adoption
Style

BT