Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use BrowserStack Automate to run Playwright or Puppeteer tests in remote browser and operating-system environments. The setup differs by framework: BrowserStack documents a sample-repository route for Playwright, while Puppeteer connects to BrowserStack’s Chrome DevTools Protocol (CDP) endpoint or can be integrated with the BrowserStack Node SDK. Choose the framework-specific browser and OS values from BrowserStack’s live support tables, then check the Automate dashboard for results and debugging artifacts.

Choose the BrowserStack route for your framework

Framework Remote setup Best starting point Important result handling
Playwright BrowserStack’s documented sample repository and parallel test script Clone the sample, install dependencies, set credentials, and run its documented command Review the completed run in the Automate dashboard
Puppeteer Connect to BrowserStack’s CDP endpoint, or integrate an existing Jest-based suite with the Node SDK Use the sample build for a direct connection; use the SDK guide for an existing suite For the direct connection sample, explicitly report pass or fail with a BrowserStack executor command

These are documented starting routes, not interchangeable recipes for every project. Browser and OS combinations, framework versions, and capability names vary. Consult the relevant live support page before building a test matrix: Playwright supported versions, browsers, and OS or Puppeteer supported browsers and OS.

Run the BrowserStack Playwright sample

BrowserStack’s parallel-testing guide documents a sample-repository workflow. Use it to confirm that your account credentials and remote execution path work before adapting the setup to a larger project.

  1. Clone the sample and enter its directory:

    git clone https://github.com/browserstack/playwright-browserstack
    cd playwright-browserstack
  2. Install the repository’s dependencies using the package manager and instructions in its current README. BrowserStack’s guide calls for installing dependencies; do not assume these sample commands are the correct setup for a different Playwright project.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    #1 Best Overall
    Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
    • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
    • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
    • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
    • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
    • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
  3. Set your BrowserStack username and access key as environment variables. On macOS or Linux, for the current terminal session:

    export BROWSERSTACK_USERNAME="YOUR_USERNAME"
    export BROWSERSTACK_ACCESS_KEY="YOUR_ACCESS_KEY"

    On PowerShell:

    $env:BROWSERSTACK_USERNAME = "YOUR_USERNAME"
    $env:BROWSERSTACK_ACCESS_KEY = "YOUR_ACCESS_KEY"

    Use your own credentials, keep the access key out of source control, and configure secrets through your CI provider’s secret store for automated runs.

  4. Run the sample’s documented parallel script:

    node parallel_test.js
  5. Open the BrowserStack Automate dashboard and inspect the completed sessions.

For a project-specific Playwright configuration, adapt the BrowserStack connection and capabilities according to the Playwright Automate overview and live support matrix. The sample repository command is not a universal command for running arbitrary Playwright suites.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Select Playwright browser and OS targets carefully

BrowserStack’s Playwright table distinguishes browser identities and supported versions. In particular, branded Chrome and Edge targets are not necessarily the same as Playwright’s bundled browser identifiers, such as Chromium, Firefox, or WebKit. Copy the capability values appropriate to the framework and target listed in the current table rather than reusing Puppeteer values or guessing a browser name.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

A useful initial matrix is the smallest set that covers the browsers and operating systems your application supports. Add combinations when a user-facing requirement or a reproducible defect calls for them; testing every available target can add cost and queue time without improving coverage for your audience.

Run a Puppeteer test through BrowserStack’s CDP endpoint

BrowserStack’s sample build connects Puppeteer to a remote browser at wss://cdp.browserstack.com/puppeteer. This is a remote connection: your script does not launch the target browser locally. The following illustrates the documented connection shape; set capability values from BrowserStack’s current Puppeteer support table, and retain the project’s actual test and page logic.

const puppeteer = require('puppeteer');

const capabilities = {
  browser: 'chrome',
  browser_version: 'latest',
  os: 'Windows',
  os_version: '10',
  name: 'Puppeteer remote test'
};

async function run() {
  const user = process.env.BROWSERSTACK_USERNAME;
  const key = process.env.BROWSERSTACK_ACCESS_KEY;
  if (!user || !key) {
    throw new Error('Set BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY');
  }

  const endpoint = 'wss://cdp.browserstack.com/puppeteer';
  const browser = await puppeteer.connect({
    browserWSEndpoint: `${endpoint}?caps=${encodeURIComponent(JSON.stringify({
      ...capabilities,
      'browserstack.username': user,
      'browserstack.accessKey': key
    }))}`
  });

  let passed = false;
  try {
    const page = await browser.newPage();
    await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });

    // Replace with assertions for your application.
    if (!(await page.title()).includes('Example')) {
      throw new Error('Unexpected page title');
    }
    passed = true;
  } finally {
    // BrowserStack's sample reports status explicitly because assertions run client-side.
    const pages = await browser.pages();
    const page = pages[0];
    if (page) {
      const status = passed ? 'passed' : 'failed';
      const reason = passed ? 'Assertions passed' : 'Test failed';
      await page.evaluate(({ status, reason }) => {
        window.browserstack_executor = {
          action: 'setSessionStatus',
          arguments: { status, reason }
        };
      }, { status, reason });
    }
    await browser.disconnect();
  }
}

run().catch(error => {
  console.error(error);
  process.exitCode = 1;
});

Install Puppeteer in your project if it is not already present, and ensure the capability names and values match BrowserStack’s current documentation. The example’s illustrative browser and OS values are not a guarantee that every version or combination is currently supported.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Report pass or fail explicitly

BrowserStack’s Puppeteer quickstart explains that assertions run on the client side in its client-server architecture, so BrowserStack cannot infer the result from the remote session alone. Its sample sends a browserstack_executor command to mark the session passed or failed. Make sure your real test runner sends the appropriate status even when an assertion throws; otherwise a failed test may not be represented correctly in the dashboard.

See BrowserStack’s Puppeteer sample build quickstart for the documented sample and executor details.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Integrate an existing Puppeteer suite with the Node SDK

If your suite already uses Jest and Puppeteer, BrowserStack documents a separate Node SDK integration path rather than requiring you to rewrite the suite around the direct CDP sample.

  1. Check the live Puppeteer Node SDK integration guide for current prerequisites. The guide cited here states Node.js 14 or later and npm; version requirements may change.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  2. Add browserstack-node-sdk as a development dependency in the project, following the guide’s current install command.

  3. Run npx setup as documented to generate browserstack.yml.

  4. Configure the supported browser and OS platforms in that file using the guide and the Puppeteer support table.

    Rank #4
    Sale
    UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
    • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
    • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
    • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
    • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
    • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
  5. Run the test suite through the SDK using the command and project configuration specified in the current integration guide.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This SDK route is an integration mechanism for an existing suite; it is distinct from manually opening a CDP connection in a sample script.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Configure parallel sessions and private-site access

Build a useful parallel matrix

In the documented Puppeteer parallel model, each browser/OS capability entry becomes a separate remote session. Parallel runs can reduce elapsed time when the matrix contains independent combinations, but actual simultaneous execution is governed by the parallel-session allowance on your BrowserStack account. Check your account entitlement and the Puppeteer parallel testing guide before assuming every configured session starts at once. BrowserStack also documents a Playwright parallel route in its Playwright parallel testing guide.

Keep the matrix tied to supported users and risk: a primary browser/OS set, plus targeted combinations for known compatibility requirements, is usually more interpretable than an indiscriminate list. Track the exact capability values and framework versions that each job uses so that a failure can be reproduced.

Test a private or locally hosted application

For a private or locally hosted site, BrowserStack’s Puppeteer getting-started material requires a secure Local Testing tunnel to be established before the remote browser can reach the application. Follow BrowserStack’s dedicated Local Testing instructions for the current tunnel setup and commands; do not assume that a remote browser can reach a developer machine or private network without that connection.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Find results and diagnose failures

After a run, inspect the session in Automate and use the available logs, console output, video, and network information to determine whether the failure came from an application assertion, a page-loading problem, or the remote session itself. BrowserStack describes these debugging artifacts for both Playwright and Puppeteer.

  • Assertion failure: verify the expected page state and test data; use the session video and logs to see what the remote browser actually did.
  • Connection or session failure: check credentials, endpoint, capability spelling, and whether the selected browser/OS combination is supported.
  • Page cannot load: confirm the URL is reachable from the remote environment; for private apps, establish Local Testing as instructed by BrowserStack.
  • Unexpected pass/fail status: in the direct Puppeteer workflow, confirm your test sends the executor status command for both success and failure paths.

Or skip the browser setup

If your goal is a page screenshot rather than an interactive cross-browser test, ScreenshotNeo offers a one-call screenshot API and an MCP server for AI agents. It does not replace BrowserStack test sessions, but it can avoid configuring a browser for screenshot capture. Its documented options include PNG, JPEG or WebP output, PDF capture, full-page and element screenshots, viewport and device settings, and custom waits.

For example, a cURL request that saves a screenshot:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie banners are accepted and removed, along with supported newsletter popups and chat widgets, before capture; bot checks, blank pages and failed loads are never billed. An MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for free.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can I use my existing Playwright project with BrowserStack’s sample command?

Not automatically. The node parallel_test.js command runs BrowserStack’s documented sample repository; adapt your own project using the Playwright Automate documentation and supported capability table.

Does connecting Puppeteer to BrowserStack automatically mark a test passed?

No. In the documented direct Puppeteer workflow, send the BrowserStack executor status command to mark the session passed or failed.

Can BrowserStack test an application running only on my machine?

A remote browser needs network access to the application. For private or locally hosted sites, BrowserStack’s Puppeteer material requires a secure Local Testing tunnel; follow its current Local Testing documentation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.