- Docs
-
Capabilities
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.
Allows you to customize the name of the test, as it will appear in the dashboard.
Group tests under the same build identifier for easy retrieval.
Run the test from a different geographical location.
Looking for more options? See all Playwright capabilities.
Copy
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();
})();