Playwright is a browser automation library that allows you to automate browser actions.GBOX provides scalable, cloud-based remote environments for Playwright automation. Instead of running browsers locally, GBOX spins up isolated browser instances in the cloud that you can control remotely through Playwright’s API. This enables you to:
Scale your automation - Run multiple Playwright tests in parallel without hardware limitations
Consistent environments - Execute tests in standardized browser environments, eliminating “works on my machine” issues
Resource efficiency - Offload browser processes to the cloud, freeing up local resources
Cross-platform testing - Access different operating systems and browser versions without local setup
Remote debugging - Debug and inspect automated browser sessions through live view capabilities
With GBOX’s remote browser environments, your Playwright scripts gain enterprise-grade scalability and reliability while maintaining the same familiar API you’re used to.
Create a new Playwright test by running the following code.
Copy
Ask AI
import GboxSDK from "gbox-sdk";import { chromium } from "playwright";import * as dotenv from "dotenv";dotenv.config();const gboxSDK = new GboxSDK({ apiKey: process.env["GBOX_API_KEY"], // This is the default and can be omitted});async function main() { const box = await gboxSDK.create({ type: "linux" }); console.log(`Box created: ${box.data.id}`); // Get browser CDP URL for Chrome DevTools Protocol connection const cdpUrl = await box.browser.cdpUrl(); console.log(`Browser CDP URL: ${cdpUrl}`); const browser = await chromium.connectOverCDP(cdpUrl); // Use the browser as usual const context = await browser.newContext(); const page = await context.newPage(); await page.goto("https://gbox.ai"); // Take a screenshot of the page await page.screenshot({ path: "screenshot.png" }); // Perform actions on the page console.log(await page.title()); // Close the browser await browser.close(); console.log("Browser closed"); // Terminate the box await box.terminate(); console.log("Box terminated");}main();
4
Run the test
Run the test by running the following command in your terminal.