Integration

BrowseFleet + Playwright

Playwright is Microsoft's cross-browser automation library supporting Chromium, Firefox, and WebKit. BrowseFleet provides a CDP endpoint that Playwright's Chromium driver can connect to using connectOverCDP. Your existing Playwright test suites and automation scripts work without modification. Just change the connection URL.

Installation

terminal
npm install playwright browsefleet

Code Example

example
import { BrowseFleet } from 'browsefleet';
import { chromium } from 'playwright';

const bf = new BrowseFleet({ apiKey: 'bf_...' });

// Create a cloud browser session
const session = await bf.sessions.create({
  stealth: 'full',
  viewport: { width: 1280, height: 720 },
});

// Connect Playwright via CDP
const browser = await chromium.connectOverCDP(
  session.websocketUrl
);

const context = browser.contexts()[0];
const page = context.pages()[0] || await context.newPage();

await page.goto('https://example.com');

// Playwright's locator API works perfectly
await page.getByRole('button', { name: 'Sign In' }).click();
await page.getByLabel('Email').fill('user@example.com');
await page.getByLabel('Password').fill('password');
await page.getByRole('button', { name: 'Submit' }).click();

// Wait for navigation
await page.waitForURL('**/dashboard');

// Extract data using Playwright's API
const items = await page.locator('.item').allTextContents();
console.log('Items:', items);

await browser.close();
await session.close();

Supported Features

  • CDP connectivity via connectOverCDP
  • Full Playwright locator API
  • Auto-waiting and smart assertions
  • Network interception and mocking
  • Screenshot and video recording
  • Multi-context browser sessions
  • Tracing and debugging tools
  • File upload and download handling
  • Stealth mode integration
  • Compatible with Playwright Test runner

Try BrowseFleet with Playwright

Free tier includes 500 daily requests. Connect Playwright in minutes.