SlideShare a Scribd company logo
4
Most read
5
Most read
8
Most read
Puppeteer
What is
“ Puppeteer is a Node
library which provides a
high-level API to control
Chrome or Chromium over
the DevTools Protocol.
Puppeteer runs headless
by default”
Puppeteer
Features
❏ Screenshots
❏ PDF prints
❏ Pre-render content and crawl SPA to SEO engines
❏ Automate form submission, UI testing, keyboard input, etc.
❏ Create an up-to-date, automated testing environment.
❏ Capture a timeline trace of your site to help diagnose
performance issues.
❏ Test Chrome Extensions.
Install
# Chromium + puppeteer
npm i puppeteer
# Puppeteer without Chromium
npm i puppeteer-core
Snapshot
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({ width: 767, height: 1024 });
await page.goto('https://getbootstrap.com/');
await page.screenshot({ path: 'bootstrap.png',
fullPage: true });
browser.close();
})();
PDF
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://github.com/');
await page.pdf({ path: 'github.pdf', format:
'A4' });
browser.close();
})();
Automating Interactions
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://www.npmjs.com');
await page.focus('#site-search');
await page.type('react');
await page.click('#npm-search > button');
await page.waitForNavigation();
await page.screenshot({ path: 'npmjs.png' });
browser.close(); })();
Testing Devices
const puppeteer = require('puppeteer');
const devices = require('puppeteer/DeviceDescriptors');
const iphone6 = devices['iPhone 6'];
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.emulate(iphone6);
await page.goto('https://www.facebook.com/');
await page.screenshot({ path: 'facebook.png' });
const host = await page.evaluate(() => location.host);
console.log(host); // www.facebook.com'
browser.close(); })();
Demo

More Related Content

PPTX
AI and ML in Test Automation Presentation
PDF
Cypress-vs-Playwright: Let the Code Speak
PPTX
Browser Automation with Playwright – for integration, RPA, UI testing and mor...
PDF
Introducing Playwright's New Test Runner
PDF
Playwright: A New Test Automation Framework for the Modern Web
PDF
What's new in selenium 4
PDF
Browser_Stack_Intro
PPTX
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
AI and ML in Test Automation Presentation
Cypress-vs-Playwright: Let the Code Speak
Browser Automation with Playwright – for integration, RPA, UI testing and mor...
Introducing Playwright's New Test Runner
Playwright: A New Test Automation Framework for the Modern Web
What's new in selenium 4
Browser_Stack_Intro
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...

What's hot (20)

PDF
Puppeteer - A web scraping & UI Testing Tool
PPTX
Puppeteer - Headless Chrome Node API
PDF
Puppeteer - Headless Chrome Node API
PDF
Puppeteer can automate that! - Frontmania
PDF
Context API in React
PDF
XSS Magic tricks
PPTX
Automation Testing by Selenium Web Driver
PPTX
Jenkins tutorial
PDF
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
PPT
Selenium
PPT
PPTX
Appium ppt
PPTX
Test automation using selenium
PDF
Flask Introduction - Python Meetup
PPTX
Automation - web testing with selenium
PPTX
Selenium locators: ID, Name, xpath, CSS Selector advance methods
PPTX
[Final] ReactJS presentation
ODP
An Introduction To Jenkins
PDF
Asynchronous JavaScript Programming
PDF
No drama here - E2E-testing django with playwright
Puppeteer - A web scraping & UI Testing Tool
Puppeteer - Headless Chrome Node API
Puppeteer - Headless Chrome Node API
Puppeteer can automate that! - Frontmania
Context API in React
XSS Magic tricks
Automation Testing by Selenium Web Driver
Jenkins tutorial
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Selenium
Appium ppt
Test automation using selenium
Flask Introduction - Python Meetup
Automation - web testing with selenium
Selenium locators: ID, Name, xpath, CSS Selector advance methods
[Final] ReactJS presentation
An Introduction To Jenkins
Asynchronous JavaScript Programming
No drama here - E2E-testing django with playwright
Ad

Similar to Puppeteer (19)

PPTX
Puppeteer (JavaScript library for UI testing)
PDF
Testing with Puppeteer - A Complete Guide.pdf
PDF
Testing with Puppeteer - A Complete Guide.pdf
PDF
Intro to Puppeteer
PDF
Export pdf with puppeteer
PDF
Playwright vs. Puppeteer : Choosing the Right Browser Automation Library.pdf
PDF
Puppeteer can automate that! - HolyJS Piter 2020
PDF
Puppeteerのお話
PPTX
How to start ui automation in 15 mins with Puppeteer
PDF
Puppeteer can automate that! - AmsterdamJS
PDF
Puppeteer: Getting Started
PDF
Puppeteer : Is it time to ditch Selenium?
PPTX
APIs for Browser Automation (MoT Meetup 2024)
PDF
vodQA Pune (2019) - Browser automation using dev tools
PPTX
Drive chrome(headless) with puppeteer
PPTX
Hacking the browser with puppeteer sharp .NET conf AR 2018
PDF
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
PPTX
Headless browser: puppeteer and git client : GitKraken
PDF
10 Best Puppeteer Alternatives in Web Scraping.pdf
Puppeteer (JavaScript library for UI testing)
Testing with Puppeteer - A Complete Guide.pdf
Testing with Puppeteer - A Complete Guide.pdf
Intro to Puppeteer
Export pdf with puppeteer
Playwright vs. Puppeteer : Choosing the Right Browser Automation Library.pdf
Puppeteer can automate that! - HolyJS Piter 2020
Puppeteerのお話
How to start ui automation in 15 mins with Puppeteer
Puppeteer can automate that! - AmsterdamJS
Puppeteer: Getting Started
Puppeteer : Is it time to ditch Selenium?
APIs for Browser Automation (MoT Meetup 2024)
vodQA Pune (2019) - Browser automation using dev tools
Drive chrome(headless) with puppeteer
Hacking the browser with puppeteer sharp .NET conf AR 2018
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
Headless browser: puppeteer and git client : GitKraken
10 Best Puppeteer Alternatives in Web Scraping.pdf
Ad

More from Adrian Caetano (9)

PPTX
Java script
PPTX
Typescript
PPTX
Web assembly
PPTX
Electron
PPTX
Protobuff
PPTX
PPTX
Frontend training
PPTX
Bff and GraphQL
PDF
Treinamento frontend
Java script
Typescript
Web assembly
Electron
Protobuff
Frontend training
Bff and GraphQL
Treinamento frontend

Recently uploaded (20)

PDF
System and Network Administration Chapter 2
PDF
Nekopoi APK 2025 free lastest update
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Digital Strategies for Manufacturing Companies
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Transform Your Business with a Software ERP System
PPTX
Introduction to Artificial Intelligence
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
System and Network Administration Chapter 2
Nekopoi APK 2025 free lastest update
ISO 45001 Occupational Health and Safety Management System
How Creative Agencies Leverage Project Management Software.pdf
Upgrade and Innovation Strategies for SAP ERP Customers
PTS Company Brochure 2025 (1).pdf.......
Digital Strategies for Manufacturing Companies
2025 Textile ERP Trends: SAP, Odoo & Oracle
Online Work Permit System for Fast Permit Processing
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Design an Analysis of Algorithms I-SECS-1021-03
Wondershare Filmora 15 Crack With Activation Key [2025
Softaken Excel to vCard Converter Software.pdf
CHAPTER 2 - PM Management and IT Context
Transform Your Business with a Software ERP System
Introduction to Artificial Intelligence
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Internet Downloader Manager (IDM) Crack 6.42 Build 41
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)

Puppeteer

  • 2. What is “ Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default”
  • 4. Features ❏ Screenshots ❏ PDF prints ❏ Pre-render content and crawl SPA to SEO engines ❏ Automate form submission, UI testing, keyboard input, etc. ❏ Create an up-to-date, automated testing environment. ❏ Capture a timeline trace of your site to help diagnose performance issues. ❏ Test Chrome Extensions.
  • 5. Install # Chromium + puppeteer npm i puppeteer # Puppeteer without Chromium npm i puppeteer-core
  • 6. Snapshot const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.setViewport({ width: 767, height: 1024 }); await page.goto('https://getbootstrap.com/'); await page.screenshot({ path: 'bootstrap.png', fullPage: true }); browser.close(); })();
  • 7. PDF const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto('https://github.com/'); await page.pdf({ path: 'github.pdf', format: 'A4' }); browser.close(); })();
  • 8. Automating Interactions const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto('https://www.npmjs.com'); await page.focus('#site-search'); await page.type('react'); await page.click('#npm-search > button'); await page.waitForNavigation(); await page.screenshot({ path: 'npmjs.png' }); browser.close(); })();
  • 9. Testing Devices const puppeteer = require('puppeteer'); const devices = require('puppeteer/DeviceDescriptors'); const iphone6 = devices['iPhone 6']; (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.emulate(iphone6); await page.goto('https://www.facebook.com/'); await page.screenshot({ path: 'facebook.png' }); const host = await page.evaluate(() => location.host); console.log(host); // www.facebook.com' browser.close(); })();
  • 10. Demo

Editor's Notes

  • #4: Headless software is software capable of working on a device without a graphical user interface. Such software receives inputs and provides output through ...