

Here is how to install puppeteer from NPM Modules Registry (npm is the package manager for JavaScript ):īelow are code snippets on how to use Puppeteer – Headless Chrome Node API in order to take screenshots of your website.Įxample – navigating to and saving a screenshot as a PNG file named example.png: Generate screenshots with PuppetteerĬonst puppeteer = require('puppeteer') (async () = `)) Ĥ. You can use Visual Regression Testing to take website screenshots and compare the generated images and identify differences pixel by pixel, a comparison image will be shown next to the result’s screenshot that highlights the differences in red. In Node.js, files and modules are in one-to-one correspondence (each file is treated as a separate module). Node.js has a simple module loading system. Note: Puppeteer requires at least Node v6.4.0 , but the examples below use async/await which is only supported in Node v7.6.0 or greater.

Other features like usage-tracking or “user metrics” feature can be found only in Chrome browser. One of the biggest differences between the two browsers is that, while Chrome is based on Chromium, Google adds some of proprietary features to Chrome, features like automatic updates and support for additional video formats. Puppeteer – Headless Chrome Node API works only with Chrome and uses the latest versions of Chromium.Ĭhromium is an open-source browser project that forms the basis for the Chrome web browser. The Chrome DevTools Protocol allows for tools to instrument, inspect, debug and profile for Chromium and Chrome browsers. What is Puppeteer? Puppeteer is Node library that you can use in order to control Headless Chrome with the DevTools Protocol.
