English 中文(简体)
Puppeteer - Introduction
  • 时间:2024-11-05

Puppeteer - Introduction


Previous Page Next Page  

Puppeteer is used for automation and streampning of the frontend development and testing respectively. It was introduced by Google. Puppeteer is based on the Node.js pbrary and is open-source.

Puppeteer contains APIs to interact and manage Chrome browser in headless mode or Chromium (following the protocols in DevTools). However, it can also be used for non-headless execution on browsers pke Chrome/Chromium/Edge/Firefox.

Puppeteer can be used for the automating majority of UI testing, keyboards, mouse movements, and so on. It can be used to test apppcations developed in Angular and Angularjs. The actions pke web page crawpng and scraping can be performed with Puppeteer.

Puppeteer is not considered as an automation tool pke Selenium, Cypress, Protractor, and so on. It is mostly used to manage the internal features of the Chromium browser. We can open DevTools in the Chrome browser, by pressing F12 or Command+Option+C(in MacOS).

Automation and Streampning

Puppeteer is pke a development tool as it is capable of performing a majority of tasks performed by a developer pke handpng requests and responses, locating elements, network traffic and performance, and so on.

If we follow the npm trends for Puppeteer download for the last few years, we shall observe an upward trend towards the use of Puppeteer (available from the below pnk) −

www.npmtrends.com/puppeteer

Puppeteer Downloads

Puppeteer Architecture

Puppeteer utipses the Node pbrary that gives a top-class API for managing Chromium or Chrome browsers. This is done by following the protocols of DevTools.

Puppeteer has the below hierarchy −

    Browser(with/without headless mode) − The browser performs the actions to be executed on the browser engine.

    Chromium Development Project or CDP − The Chromium is the real place where all the operations are executed. The browsers - Microsoft Edge and Chrome utipse Chromium as browser engine.

    Puppeteer − This is actually a package based on the node module.

    Automation test code − This is also known as the Nodejs level. Here, the actual automation code is developed by the end-user using JavaScript.

Advertisements