Playwright Capabilities Generator

Generate Playwright connection options for your automated tests. Choose your browser, device emulation and configuration options to get the exact code you need for your Playwright tests.

Looking for more options? See all Playwright capabilities.

const playwright = require('playwright-core');

(async () => {
  const capabilities = {
    browserName: 'chrome',
    browserVersion: 'latest',
    platformName: 'Windows 11',
    'tb:options': {
      'key': process.env.TB_KEY,
      'secret': process.env.TB_SECRET
    }
  }
  const browser = await playwright.chromium.connect({
    wsEndpoint: `wss://cloud.testingbot.com/playwright?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
  });
  const context = await browser.newContext();
  const page = await context.newPage();

  await page.goto('https://testingbot.com/');
  await page.screenshot({ path: 'screenshot.png' });

  await browser.close();
})();