- Puppeteer-core controls Edge via CDP: lightweight installation and Boot directly from the executable.
- Best practices: Mocha/Chai, Page Object Model, explicit waits and captures.
- Debugging and CI: headless/shell, network listeners, caching, and parallelization.
- Edge Ecosystem: DevTools, Playwright, WebDriver, webhint and Origin Testing.

Automating end-to-end testing in Microsoft Edge with Puppeteer is a safe bet these days: Edge is based on Chromium and Puppeteer speaks the same language (CDP), so they fit like a glove for fast, reliable, and fine-tuned browser testing.
In this guide, we go into detail about everything you need: installation, differences between Puppeteer and Puppeteer-core, starting Edge with and without a interface, detecting the executable, code examples (Mocha/Chai, Page Object Model, forms, screenshots), debugging tips , CI/CD integration and ecosystem tools (DevTools Protocol, Playwright, WebDriver, webhint, Source Testing), plus notes on wrappers like Puppeteer-Sharp or the Dart package.
What is Puppeteer and why it fits with Microsoft Edge?
Puppeteer is a Node.js library that controls Chromium-based browsers (Chrome and Edge) using the Chrome DevTools Protocol (CDP). By default, it starts in headless mode (without a UI), but you can display the window to see it running live.
Edge and Puppeteer work seamlessly together because Edge shares the Chromium base. Therefore, with puppeteer-core you can manage an existing Microsoft Edge installation, leveraging its core engine and avoiding the need to download additional Chromium if you already have Edge installed.
What will you use it for on a daily basis? GUI testing, dynamic content scraping, performance measurement, PDF/screenshot generation, and visual regression validation, all with a high-level API and great stability.

Installation: puppeteer vs puppeteer-core
There are two flavors that should be distinguished: puppeteer (full package that downloads Chromium) and puppeteer-core (lightweight, does not download browser and connects to an existing executable like Edge).
Recommended installation for Edge if you already have the browser: use puppeteer-core with npm or yarn to save downloads and work directly on your local Edge.
Quick installation commands for the core: npm i puppeteer-core or yarn add puppeteer-core, making sure you have Node updated (older guides cite v8.9+ and async/await support from v7.6; nowadays v14+ is recommended).
Start Microsoft Edge with puppeteer-core step by step
The typical sequence is to create a browser instance, open a new page, navigate to a URL, and perform actions (clicks, typing, screenshots). With Edge, you only need to specify the correct executable.
A minimal working example that opens Edge, visits a page, and saves a screenshot. Replace the path if you prefer to locate it programmatically (we'll see this in the next section).
const puppeteer = require('puppeteer-core');
(async () => {
const browser = await puppeteer.launch({
executablePath: 'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe',
headless: true
});
const page = await browser.newPage();
await page.goto('https://www.microsoft.com/edge/download/insider');
await page.screenshot({ path: 'example.png' });
await browser.close();
})();
If you are using macOS or Linux , set executablePath to the location of Edge on your system (for example, on macOS Canary it might be /Applications/Microsoft\ Edge\ Canary.app/Contents/MacOS/Microsoft\ Edge\ Canary).
Locate Edge executable path (manual and programmatic)
Simple manual method : Type edge://version in the Edge address bar and copy the executable path that appears on that page.
Programmatic route in Node : use the edge-paths package to retrieve the correct path on each OS and thus avoid hardcoding specific values.
const edgePaths = require('edge-paths');
const EDGE_PATH = edgePaths.getEdgePath();
// Luego úsalo en el launch
const puppeteer = require('puppeteer-core');
(async () => {
const browser = await puppeteer.launch({ executablePath: EDGE_PATH });
const page = await browser.newPage();
await page.goto('https://www.microsoft.com/edge/download/insider');
await page.screenshot({ path: 'edge-insider.png' });
await browser.close();
})();
Advantage of this cross-platform approach: your pipeline or your team doesn't have to manually edit the path on Windows , macOS, or Linux.
Execution modes: headless and interfaced
Headless is faster and lighter , ideal for CI/CD. You can toggle UI visible (headful) to see what happens at each step, or activate slowMo to debug interactions.
New in modern versions : Puppeteer can use a headless mode based on chrome-headless-shell by setting headless: 'shell', which improves performance in certain environments.
const browser = await puppeteer.launch({
executablePath: EDGE_PATH,
headless: 'shell', // o true/false según necesites
args: ['--no-sandbox'] // útil en contenedores
});
Note compatibility : Some features, such as printing to PDF, may require headless true in certain versions; check your pipeline.
Ecosystem of related tools in Edge
- DevTools Protocol: is the foundation of Puppeteer. It allows you to instrument, inspect, debug, and profile browsers, including Microsoft Edge, with API parity with Chromium.
- Origin Trials: a mechanism for evaluating experimental APIs on real sites for a limited time, providing feedback to standards teams and browser engineers.
- playwright: A high-level alternative with multibrowser support via a single, reliable, and fast API, also compatible with Edge. Useful if you need to cover Firefox and WebKit in parallel.
- WebDriver: A standard for automating browsers by simulating real-world user interaction (windows, tabs, OS events). Advantageous when looking for cross-browser and cross-language coverage.
- webhint and its extension for VS Code: Best practice linting that detects common accessibility, performance, cross-browser compatibility, PWA, and security issues, and can be integrated into your workflow.
Puppeteer vs Selenium: When to Choose Each One
Puppeteer shines in speed and control over Chromium browsers, with a simple API for JS/Node teams and great precision of actions, perfect for headless testing or advanced scraping.
Selenium offers breadth (browsers and languages): whether your goal is to validate in Chrome, Firefox, Safari and Edge and/or your team programs in Java, C#, Python or Ruby, Selenium's coverage and ecosystem remain a guarantee.
And specifically for Edge? If you're only targeting Edge/Chromium, Puppeteer is straightforward, fast, and very stable; if your compatibility requirements include more browsers, consider Selenium or Playwright.
Best practices for testing with Mocha/Chai and the Page Object Model
Mocha as a test runner and Chai as an assertion library are a perfect fit for Puppeteer. `beforeEach` and `afterEach` help open/close the browser and keep tests isolated.
The Page Object Model (POM) structures the project into classes per page, encapsulating selectors and actions. This improves maintainability, reusability, and test readability.
// pages/HomePage.js
class HomePage {
constructor(page) { this.page = page; }
async title() { return this.page.title(); }
async search(word) {
await this.page.type('input[id=search_form_input_homepage]', word);
await this.page.click('input[type="submit"]');
}
}
module.exports = HomePage;
// pages/ResultsPage.js
class ResultsPage {
constructor(page) { this.page = page; }
async linksCount() {
await this.page.waitForSelector('h2 a');
return await this.page.$$eval('h2 a', as => as.length);
}
}
module.exports = ResultsPage;
Example test with DuckDuckGo that validates the title and that a search generates results, showing the POM pattern in action.
const puppeteer = require('puppeteer');
const { expect } = require('chai');
const HomePage = require('./pages/HomePage');
const ResultsPage = require('./pages/ResultsPage');
describe('Búsqueda en DuckDuckGo con POM', () => {
let browser, page;
beforeEach(async () => {
browser = await puppeteer.launch();
page = await browser.newPage();
await page.goto('https://duckduckgo.com');
});
afterEach(async () => { await browser.close(); });
it('muestra el título esperado', async () => {
const home = new HomePage(page);
expect(await home.title()).to.include('DuckDuckGo');
});
it('devuelve resultados al buscar', async () => {
const home = new HomePage(page);
await home.search('puppeteer');
const results = new ResultsPage(page);
expect(await results.linksCount()).to.be.greaterThan(0);
});
});
Practical tip : centralize your selectors in POM classes and avoid duplicating them in tests to facilitate refactoring when the DOM changes.
Automation of forms, captures and PDFs
Filling in inputs, clicking buttons, and checking messages are part of the daily routine. You can take screenshots at key steps and validate DOM text to confirm complete flows.
Example inspired by an Angular SPA with form validations, navigation, and screen captures:
await page.goto('https://angular-6-registration-login-example.stackblitz.io/register');
await page.click('a.btn.btn-link'); // Cancel
await page.click('a.btn.btn-link'); // Register
await page.click('button.btn.btn-primary'); // Validaciones vacías
await page.screenshot({ path: 'form-feedback.png' });
await page.type('input[formcontrolname="firstName"]', 'Monitor');
await page.type('input[formcontrolname="lastName"]', 'Pruebas');
await page.type('input[formcontrolname="username"]', 'pruebas');
await page.type('input[formcontrolname="password"]', 'MISO4208');
await page.click('button.btn.btn-primary');
await page.waitForSelector('div.alert.alert-success');
await page.type('input[formcontrolname="username"]', 'pruebas');
await page.type('input[formcontrolname="password"]', 'MISO4208');
await page.click('button.btn.btn-primary');
await page.waitForSelector('h1');
await page.screenshot({ path: 'after-login.png' });
Generating PDFs is straightforward with page.pdf; useful for reports or visual proofs of a specific view in the pipeline.
Debugging and Performance: Time-Saving Tricks
Use waitForSelector to synchronize with the DOM and avoid arbitrary sleeps. Add logs and network listeners to diagnose load failures or 404/500 errors.
page.on('requestfailed', req => {
console.error('Fallo de solicitud:', req.url(), req.failure()?.errorText);
});
await page.waitForSelector('#mi-elemento', { timeout: 10000 });
Visual debugging : alternate headless: false and slowMo to see step by step; in modern headless try headless: 'shell' to improve stability and performance in CI.
Block unnecessary resources (images, fonts) if you only care about the DOM/text to reduce consumption and speed up scraping tests.
Integration in CI/CD and execution in containers
In CI, headless is recommended, and arguments like `--no-sandbox` are useful in root or container environments . Keep Node updated and consider reusing the system's Chromium/Edge to avoid downloads with each build.
Strategies for efficient pipelines : parallelize suites, cache node_modules and the browser folder, and separate quick smoke tests from heavier end-to-end tests.
Cloud services like BrowserStack can help with cross-browser arrays; for pure Edge/Chromium, Puppeteer on Linux runners is fast and stable.
Monitoring and metrics during testing
If you need observability , integrate modules that collect browser performance metrics (DOM nodes, layout and style recalculation times, script/task duration, JS heap and HTTP code) and send them to your APM platform.
Tools like webhint and Performance in DevTools help detect bottlenecks, optimization opportunities, and compatibility issues that can intermittently break your tests.
Beyond Node: Wrappers and Extended Compatibility
Puppeteer-Sharp (C#) has demonstrated high compatibility with Edge, being Chromium-based; real-world experiences show that most tests pass with minimal adjustments.
The Dart bundle also exists, useful if you work with that ecosystem: you can launch the browser, navigate, and automate actions with a familiar API.
Expanding compatibility : Recent versions of Puppeteer have worked on support for other browsers like Firefox and are moving towards standards like WebDriver BiDi, bringing together the best of CDP and classic WebDriver.
Other tools and approaches for edge testing
Playwright offers multi-browser automation with a single API; if you need Firefox/WebKit in addition to Edge, it saves you headaches with a modern and robust syntax.
WebDriver remains key in multilingual enterprise scenarios and with strong integration into existing frameworks, offering advantages in window management and user events.
DevTools protocol directly : if you require very fine instrumentation (traces, advanced network interception, coverage), you can combine CDP with Puppeteer for low-level diagnostics.
Useful recipes with Edge: from zero to value
Full-size screenshot of a critical page to review UI changes in pull requests or run visual regression tests.
await page.goto('https://tu-sitio');
await page.screenshot({ path: 'full.png', fullPage: true });
Intelligent waiting by combining browsing and network idleness for heavy SPA applications that cascade resource loads.
await page.goto('https://app.tu-sitio', { waitUntil: 'networkidle0' });
Dynamic data extraction with $$eval and evaluate to transform the DOM into data structures ready for your backend.
const items = await page.$$eval('.card', cs => cs.map(c => ({
title: c.querySelector('h2')?.textContent?.trim() || '',
link: c.querySelector('a')?.href || ''
})));
Robust error handling with try/catch and rich logs to understand intermittent failures and reduce flakiness.
try {
await page.waitForSelector('#checkout', { timeout: 8000 });
} catch (e) {
console.error('Elemento checkout no apareció a tiempo');
await page.screenshot({ path: 'timeout-checkout.png' });
throw e;
}
This journey prepares you to move from theory to value: reliable, fast, and maintainable testing on Microsoft Edge with minimal friction.
Table of Contents
- 1 What is Puppeteer and why it fits with Microsoft Edge?
- 2 Installation: puppeteer vs puppeteer-core
- 3 Start Microsoft Edge with puppeteer-core step by step
- 4 Locate Edge executable path (manual and programmatic)
- 5 Execution modes: headless and interfaced
- 6 Ecosystem of related tools in Edge
- 7 Puppeteer vs Selenium: When to Choose Each One
- 8 Best practices for testing with Mocha/Chai and the Page Object Model
- 9 Automation of forms, captures and PDFs
- 10 Debugging and Performance: Time-Saving Tricks
- 11 Integration in CI/CD and execution in containers
- 12 Monitoring and metrics during testing
- 13 Beyond Node: Wrappers and Extended Compatibility
- 14 Other tools and approaches for edge testing
- 15 Useful recipes with Edge: from zero to value