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

Short answer: use Puppeteer to launch and control the browser, use Chrome’s documented fake-media flags when you need deterministic camera input, and let the application’s WebRTC code call getUserMedia() or getDisplayMedia() and add tracks to its RTCPeerConnection. Puppeteer can verify the rendered call UI and, experimentally, record the browser page. It does not create, relay, or directly extract WebRTC media tracks.

Understand what Puppeteer automates—and what WebRTC does

A WebRTC call has separate responsibilities:

  • Capture: navigator.mediaDevices.getUserMedia() supplies camera and microphone tracks. getDisplayMedia() supplies a screen, window, or tab capture when the product supports it.
  • Connectivity: an application creates an RTCPeerConnection, exchanges offers, answers and ICE candidates through its signaling system, and sends media between peers (or through the application’s chosen media infrastructure).
  • Browser automation: Puppeteer opens pages, clicks controls, fills forms, waits for states and inspects DOM or browser APIs.

A local MediaStream contains tracks. The application normally adds each track to its peer connection with addTrack(). The receiving side observes incoming media through the peer connection’s track event and attaches the resulting stream to a video element. Your test should therefore assert application-visible outcomes—such as a connected status, a receiving video element becoming playable, or an “in call” indicator—rather than treating Puppeteer as a media transport.

Choose deterministic media input

Chrome’s generated fake device

For UI and integration tests, Chrome documents flags that bypass the media-permission prompt and provide a generated test pattern:

--use-fake-ui-for-media-stream
--use-fake-device-for-media-stream

These are Chrome testing options. They are not a promise that another browser, or a different Chrome/Puppeteer release, behaves identically. Use the browser binary and Puppeteer version that your project supports, and verify the flags after upgrades.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works

A deterministic Y4M video file

When a test needs known visual content rather than a generated pattern, add Chrome’s file-backed fake capture flag:

--use-fake-ui-for-media-stream
--use-file-for-fake-video-capture=/absolute/path/to/test.y4m

The file must be a Y4M test-video file accepted by the Chrome build you run. Keep the path absolute and make the fixture available in CI. This flag supplies video; microphone behavior still depends on the fake-device setup and the application’s requested constraints.

When to use a real device

A physical camera or microphone can reveal device-specific problems, but it makes tests sensitive to hardware, permissions, drivers and ambient conditions. Reserve it for a separately managed hardware suite. Do not make a real device a prerequisite for a deterministic browser test.

Launch Chrome and grant origin permissions

The following harness shows the browser setup. Replace the origin with your application and use the fake-device flags only in the test profile. Puppeteer’s permission API is origin-scoped; confirm the exact behavior against the Puppeteer release installed in your project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({
  headless: true,
  args: [
    '--use-fake-ui-for-media-stream',
    '--use-fake-device-for-media-stream',
    // Or use a deterministic fixture:
    // '--use-file-for-fake-video-capture=/workspace/fixtures/camera.y4m'
  ]
});

const context = await browser.createBrowserContext();
await context.setPermission('https://app.example.test', ['camera', 'microphone']);

const page = await context.newPage();
await page.goto('https://app.example.test/call', { waitUntil: 'networkidle0' });
// Interact with your product's controls here.

await browser.close();

Use an isolated browser context per test or scenario so cookies, local storage and permissions do not leak between actors. If your application uses a different origin for an embedded frame or signaling endpoint, grant permissions to the origin that actually calls the media API, not merely the top-level page.

Drive the call through the application UI

Prefer the same actions a user performs: sign in with a test account, open the call route, click “Join,” and wait for the product’s own connected state. A generic interaction skeleton is:

await page.getByRole('button', { name: 'Join call' }).click();
await page.waitForSelector('[data-call-state="connected"]');
await page.waitForFunction(() => {
  const video = document.querySelector('video[data-remote]');
  return video && video.readyState >= 2 && !video.paused;
});

Use selectors owned by your application (for example, data attributes) instead of brittle class names. The exact signaling flow, room identifier and authentication method are application-specific; Puppeteer cannot infer them.

Rank #2
Sale
EMEET S600 4K Webcam for Streaming, Sony 1/2.55'' Sensor, PDAF Autofocus
  • Unmatched 4K Streaming Quality - The EMEET S600 streaming camera boasts a high-definition 4K sony 1/2.55'' sensor, delivering crisp, clear images far exceeding typical webcam quality. With versatile resolution options, enjoy stunning 4K at 30FPS or smooth 1080P at 60FPS. Ideal for aspiring streamers, game streaming, and content creation, this 4K webcam ensures exceptional experience for you and your audience. Note: Video resolution depends on built-in camera software or apps like PotPlayer/OBS.
  • Advanced PDAF Autofocus & Light Balance – 4K webcam S600's PDAF(Phase Detection Autofocus) tech offers significant advantages over common autofocus such as faster speed, higher precision, and more stable performance in various scenes features. Its auto light adjustment capability balances shadows and highlights even in low-light environments, keeping every detail sharp and clear on screen, making it ideal for content creators and live streamers who demand top-tier performance and visual quality.
  • Enhanced Audio Clarity & Customizable FOV - The EMEET S600 4K streaming webcam is equipped with premium microphones that use a proprietary algorithm to filter out background noise and capture your voice with exceptional clarity. Noise-canceling feature is enabled by default but can be turned off through the EMEETLINK software. At 1080P, the FOV adjusts 40°-73°, allowing you to focus on you and surroundings, while at 4K, it’s fixed at 73° for better image quality and less distortion.
  • Integrated Privacy Cover & Rugged Design - The 4K webcam for streaming boasts a built-in privacy cover right on the lens, ensuring it won't accidentally open or get touched. Crafted with meticulous engineering, every component of the S600, from the clips to the joints, is designed for durability and stability. Unlike traditional 4K streaming cameras, S600 webcam for PC offers flexible rotation and wide-angle tilting while staying securely in place, making it easier to find your ideal angle.
  • Effortless Setup with Customization Option - S600 2.0&3.0 USB webcam offers a seamless plug-and-play experience, compatible with nearly all popular operating systems and software, no extra software required for use. Just plug it in, and you’re ready to go, making it an easy addition to your workflow. For those looking to fine-tune image parameters or enhance sound quality, EMEETLINK software is available for advanced customization. Both simplicity and advanced needs can be met effortlessly.

Inspect capture and peer-connection state in the page

You can ask the page whether tracks and receivers exist without attempting to move media through Node.js:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const state = await page.evaluate(() => ({
  mediaDevices: !!navigator.mediaDevices,
  videoElements: [...document.querySelectorAll('video')].map(v => ({
    readyState: v.readyState,
    paused: v.paused,
    width: v.videoWidth,
    height: v.videoHeight
  }))
}));
console.log(state);

For a product that exposes its peer connection for testing, you can inspect connectionState, iceConnectionState, sender track counts and receiver track counts. If the application keeps the connection private, add a test-only diagnostic surface rather than relying on unsupported browser internals.

How the application’s WebRTC code fits in

The application—not Puppeteer—owns the media and signaling logic. A simplified browser-side pattern looks like this:

const local = await navigator.mediaDevices.getUserMedia({
  video: true,
  audio: true
});

const pc = new RTCPeerConnection();
for (const track of local.getTracks()) {
  pc.addTrack(track, local);
}

pc.addEventListener('track', event => {
  const [stream] = event.streams;
  document.querySelector('video[data-remote]').srcObject = stream;
});

This snippet omits signaling deliberately: exchanging the offer, answer and ICE candidates requires your application’s signaling channel and deployment design. The same separation applies to screen sharing: call getDisplayMedia(), then add the returned tracks to the connection. A Puppeteer test can click the share button and assert the resulting UI, but it does not replace signaling, STUN/TURN, an SFU or other production infrastructure.

Can Puppeteer record a WebRTC stream?

There are two different meanings of “record.” Recording the underlying WebRTC track requires application-side Web APIs such as a MediaRecorder attached to a stream, plus your own handling of the resulting chunks. That is distinct from Puppeteer’s browser-output recording.

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

Page.record()

Current Puppeteer documentation describes Page.record() as experimental and producing an MP4 recording of page output. Treat its API and browser compatibility as version-sensitive; check the reference matching your installed Puppeteer release before making it a required artifact. A page recording captures what the browser renders, not a guaranteed export of every WebRTC media track or an original camera bitstream.

Page.screencast()

Current documentation marks Page.screencast() obsolete. Older workflows used WebM/VP9 output and required FFmpeg. Do not start a new test architecture around it without confirming the method and dependencies in your exact release.

Rank #3
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)

When an application-side recorder is appropriate

If your requirement is to validate recording, implement or expose a test-only path in the web application that records the intended local or remote MediaStream. Then use Puppeteer to trigger that path and verify that the application produces the expected file or upload result. Keep this separate from a page screenshot or page-level MP4 artifact.

Network conditions: a critical limitation

Puppeteer’s emulateNetworkConditions() is useful for browser networking scenarios, but its documented behavior does not affect WebSockets or WebRTC RTCPeerConnections. Therefore, do not present it as a packet-loss, latency, bandwidth or disconnect test for a live WebRTC call.

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

For WebRTC impairment testing, use a mechanism you have separately verified at the network or media-infrastructure layer—for example, a controlled test network, proxy, operating-system traffic shaper, or a test SFU feature. The correct choice depends on where your application’s signaling and media actually flow. Keep UI/integration tests (which validate call behavior under normal conditions) separate from network, interoperability and production-load tests.

Assertions that produce useful failures

  • Permission and capture: the expected origin is granted camera/microphone permission; getUserMedia() resolves; local tracks are present and not immediately ended.
  • Signaling: the UI reports the expected room and connection state; offer/answer and ICE errors are surfaced in test logs.
  • Remote media: a remote video element receives a stream, reaches a usable readyState, has non-zero dimensions and starts playback.
  • Lifecycle: leaving the call stops local tracks, closes the peer connection and removes the remote stream.
  • Artifacts: if you use page recording, store it as a browser-output artifact and label it accordingly; do not call it a raw WebRTC-track recording.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common failures

The permission prompt blocks the test

Check that the browser was launched with the documented fake-UI flag and that permission was granted to the exact origin invoking getUserMedia(). A different port, subdomain or iframe origin is a different permission scope. Also verify that your installed Chrome and Puppeteer versions still support the flags and permission call.

getUserMedia() rejects or returns no tracks

Confirm the page is in a secure context, the requested constraints match what the fake device supplies, and the test is using the intended Chrome binary. Log the exception name and message in the page. If you switched to a Y4M fixture, verify its absolute path, file availability in CI and format compatibility.

The local preview works but the remote video stays blank

This usually places the fault beyond capture: inspect signaling messages, ICE state, connection state, receiver tracks and the remote video element’s srcObject. A successful local camera preview does not prove that a peer connection was negotiated or that a remote track arrived.

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

The test passes locally and fails in CI

Pin or otherwise control the Chrome/Puppeteer versions, use an isolated profile, ensure the Y4M fixture exists at the same path, and record browser console and page errors. Avoid assertions based on timing alone; wait for a connection state or video readiness condition owned by the application.

Rank #4
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
  • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
  • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
  • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video

Network emulation did not create packet loss

That result is expected for WebRTC peer connections. Move the impairment test to a verified network or media-infrastructure layer instead of relying on Puppeteer’s page network emulation.

Performance, reliability and cost considerations

Fake media removes hardware variability, but it does not make signaling or media infrastructure deterministic. Run only the number of concurrent browser actors your CI host can support, and separate browser resource limits from media-server capacity. Collect timestamps for join, connection-state transitions and first remote frame so regressions are diagnosable; do not treat them as universal latency benchmarks.

Page-level recording can consume substantial CPU, memory and disk, especially for long calls. Enable it only for failing scenarios or targeted evidence, and verify the experimental API on every Puppeteer upgrade. For routine checks, DOM and application-state assertions are cheaper and less fragile.

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.

Or skip the browser setup

If your goal is a clean image or PDF of the call interface rather than a WebRTC-track artifact, ScreenshotNeo provides a single HTTP capture request. It removes cookie banners, newsletter popups and chat widgets before the shot; bot checks, blank pages and failed loads are not billed; and its MCP server lets AI agents such as Claude or Cursor call screenshot tools.

cURL (see the ScreenshotNeo API documentation):

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

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Frequently Asked Questions

Does Puppeteer create a WebRTC peer connection?

No. The web application creates and manages its RTCPeerConnection; Puppeteer drives the page and observes outcomes.

Can I use the same fake-media flags in every browser?

No. The documented flags are Chrome testing options. Verify equivalent behavior for the browser and versions in your test matrix.

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

What should I save when a call test fails?

Capture browser console and page errors, connection-state diagnostics, a screenshot or page recording when useful, and the application’s signaling logs.

Quick Recap

SaleBestseller No. 1
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Built-In Mic: The built-in microphone lets others hear you clearly during video calls
$35.90
Bestseller No. 4
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Fully compatible with Windows 11
$69.99

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.