Prompt

How do I automate browser testing across Chrome, Firefox, and Edge?

Technology / Testing & QA1 observationLast seen Oct 26, 2026

Latest observation

Oct 26, 2026OpenAI APIWeb search: off

A common way to automate browser testing across Chrome, Firefox, and Edge is to use a cross-browser testing framework like Playwright or Selenium. For most modern projects, I’d recommend Playwright because it’s fast, reliable, and has built-in support for all three browsers.

Best option: Playwright

Why Playwright?

  • Supports Chromium (Chrome/Edge), Firefox, and WebKit
  • Easy to run the same test in multiple browsers
  • Good auto-waiting, reducing flaky tests
  • Works well in CI/CD

Basic setup

1) Install Playwright

npm init playwright@latest

Or if you already have a Node project:

npm install -D @playwright/test
npx playwright install

2) Configure browsers

Playwright can run tests across browsers via the config file.

Example playwright.config.ts:

import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'] },
    },
    {
      name: 'firefox',
      use: { ...devices['Desktop Firefox'] },
    },
    {
      name: 'edge',
      use: { channel: 'msedge' },
    },
  ],
});

3) Write a test

Example tests/example.spec.ts:

import { test, expect } from '@playwright/test';

test('homepage has title', async ({ page }) => {
  await page.goto('https://example.com');
  await expect(page).toHaveTitle(/Example Domain/);
});

4) Run tests in all browsers

npx playwright test

Alternative: Selenium

Selenium is another popular choice, especially if you need:

  • Existing Selenium/Grid infrastructure
  • Language support beyond JavaScript/TypeScript
  • Compatibility with older test suites

Example using Selenium with Node.js

Install:

npm install selenium-webdriver

Example:

const { Builder } = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');
const firefox = require('selenium-webdriver/firefox');
const edge = require('selenium-webdriver/edge');

async function testBrowser(browserName) {
  let builder = new Builder().forBrowser(browserName);

  if (browserName === 'chrome') {
    builder.setChromeOptions(new chrome.Options());
  } else if (browserName === 'firefox') {
    builder.setFirefoxOptions(new firefox.Options());
  } else if (browserName === 'MicrosoftEdge') {
    builder.setEdgeOptions(new edge.Options());
  }

  const driver = await builder.build();
  try {
    await driver.get('https://example.com');
    console.log(await driver.getTitle());
  } finally {
    await driver.quit();
  }
}

(async () => {
  await Promise.all([
    testBrowser('chrome'),
    testBrowser('firefox'),
    testBrowser('MicrosoftEdge'),
  ]);
})();

Recommended approach for CI

Run tests in a pipeline like GitHub Actions, Azure DevOps, or GitLab CI.

Example GitHub Actions for Playwright:

name: Playwright Tests

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npx playwright install --with-deps
      - run: npx playwright test

Practical tips

  • Use stable selectors like data-testid
  • Prefer explicit assertions over fixed delays
  • Test critical flows in all browsers, not necessarily every tiny UI detail
  • Keep browser-specific workarounds isolated

If you want, I can give you:

  1. a Playwright starter template,
  2. a Selenium version in your preferred language, or
  3. a CI pipeline example for GitHub Actions/Azure DevOps.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.