Skip to content

Smoke Test

Status: NEEDS-ACCOUNT

Classification: NEEDS-ACCOUNT (cloud API, paid) Install method: No dedicated SDK. Use puppeteer-core (npm install puppeteer-core) as the client. Connect via Bright Data WebSocket endpoint. Cost tier: Paid. Requires an active BrightData account with a Browser API zone configured. See brightdata.com for current pricing. What is required: A BrightData account at brightdata.com, an active Browser API zone, and zone credentials (BRD_USERNAME, BRD_PASSWORD). No self-hosted option.

The smoke test verifies that your credentials are valid and that you can open a remote session, navigate to a public page, and receive rendered HTML back.


Prerequisites

  • Zone credentials set as environment variables (BRD_USERNAME, BRD_PASSWORD)
  • puppeteer-core installed (npm install puppeteer-core)

Test script

Save this as smoke-test.js and run it:

javascript
#!/usr/bin/env node
const puppeteer = require('puppeteer-core');

const AUTH = `${process.env.BRD_USERNAME}:${process.env.BRD_PASSWORD}`;
const TARGET_URL = 'https://quotes.toscrape.com/js/';

(async () => {
  console.log('[1/4] Connecting to BrowserAI...');
  const browser = await puppeteer.connect({
    browserWSEndpoint: `wss://${AUTH}@brd.superproxy.io:9222`,
  });

  console.log('[2/4] Opening new page...');
  const page = await browser.newPage();

  console.log('[3/4] Navigating to target URL...');
  await page.goto(TARGET_URL, { timeout: 120_000 });

  const title = await page.title();
  const html = await page.content();
  console.log(`[4/4] Page title: "${title}"`);
  console.log(`      HTML length: ${html.length} chars`);

  await browser.close();
  console.log('PASS: BrowserAI session completed successfully.');
})().catch((err) => {
  console.error('FAIL:', err.message);
  process.exit(1);
});

Run command

bash
node smoke-test.js

Expected success output

[1/4] Connecting to BrowserAI...
[2/4] Opening new page...
[3/4] Navigating to target URL...
[4/4] Page title: "Quotes to Scrape"
      HTML length: 11432 chars
PASS: BrowserAI session completed successfully.

The HTML length will vary. The critical success indicators are:

  • No connection error at step 1 (bad credentials produce Error: connect ECONNREFUSED or 401 Unauthorized)
  • A non-empty page title at step 4
  • The PASS line printed and the process exits with code 0

Failure diagnosis

ErrorLikely cause
401 Unauthorized or 407 Proxy Auth RequiredWrong BRD_USERNAME or BRD_PASSWORD
Error: connect ECONNREFUSEDZone not active; check the zone status in the Control Panel
TimeoutError: Navigation timeoutTarget site is slow; increase timeout or try a different URL
Error: Zone not foundZone name in the username does not match an active zone

Note on local test execution

This test requires valid Bright Data credentials and an active Browser API zone. It cannot be run without a paid account. The script is not runnable in a sandboxed CI environment without credential injection.