# AgentSandbox.host > Browser testing at scale with Playwright and Selenium: setup in Python and Node.js, Docker images, Selenium Grid, parallel runs, sharding and flaky tests. Each article is signed by its author and carries a published date and an updated date. Every page has a Markdown copy: add index.md to its address. ## Articles - [How to fix flaky browser tests in Playwright and Selenium](https://www.agentsandbox.host/p/fix-flaky-browser-tests/): Fix flaky browser tests by first proving they are flaky (run them many times), then separating environment trouble from test bugs, then removing the cause, usually timing, shared state or overloaded machines. Retries and traces find flaky tests; auto-waiting, isolation and fewer workers fix them. [Markdown](https://www.agentsandbox.host/p/fix-flaky-browser-tests/index.md) - [Playwright CLI: every command and the test options that matter](https://www.agentsandbox.host/p/playwright-cli-commands/): The Playwright CLI is the npx playwright command. Its main commands are test, show-report, show-trace, codegen (record a test), install and install-deps (browsers and system packages) and merge-reports; npx playwright test takes options for filters, workers, shards, retries, traces and debugging. [Markdown](https://www.agentsandbox.host/p/playwright-cli-commands/index.md) - [Playwright async in Python: when to use it and how](https://www.agentsandbox.host/p/playwright-python-async/): Use Playwright's async API in Python when your code already runs on asyncio. Import async_playwright from playwright.async_api, await every call, and start it with asyncio.run. For pytest, install pytest-playwright-asyncio and mark tests with the session loop scope. [Markdown](https://www.agentsandbox.host/p/playwright-python-async/index.md) - [Playwright with Python: install it and write your first test](https://www.agentsandbox.host/p/playwright-python-tutorial/): To start with Playwright in Python, install the pytest plugin with pip install pytest-playwright, download the browsers with playwright install, write a test function that takes the page fixture, and run pytest. Tests run headless in Chromium by default; --headed and --browser change that. [Markdown](https://www.agentsandbox.host/p/playwright-python-tutorial/index.md) - [Playwright testing with Node.js: install, first test, config](https://www.agentsandbox.host/p/playwright-testing-with-node/): To start Playwright testing in Node.js, run npm init playwright@latest, which adds @playwright/test, a playwright.config.ts and an example test, then run npx playwright test. Tests use the page fixture, role-based locators and retrying assertions; npx playwright show-report opens the results. [Markdown](https://www.agentsandbox.host/p/playwright-testing-with-node/index.md) - [Run browser tests in parallel: workers on one machine, shards across many](https://www.agentsandbox.host/p/run-browser-tests-in-parallel/): On one machine, run browser tests in parallel with Playwright Test's worker processes (by default half the logical CPU cores) or pytest-xdist. Across machines, split the suite with --shard=x/y, one shard per machine or sandbox, and set fullyParallel so shards get an even share. [Markdown](https://www.agentsandbox.host/p/run-browser-tests-in-parallel/index.md) - [Run Playwright tests in Docker with the official image](https://www.agentsandbox.host/p/run-playwright-tests-in-docker/): Run Playwright tests in Docker from the official image tagged with your exact Playwright version, such as mcr.microsoft.com/playwright:v1.65.1-noble, with --init and --ipc=host, then npm ci and npx playwright test inside it. The image has the browsers but not your Playwright package. [Markdown](https://www.agentsandbox.host/p/run-playwright-tests-in-docker/index.md) - [Selenium Grid: what it is and how to run it in Docker](https://www.agentsandbox.host/p/selenium-grid-docker/): Selenium Grid runs WebDriver tests on remote browsers by routing each session from one address to Nodes that host the browsers. In Docker, start selenium/standalone-chrome for one container, or a selenium/hub with selenium/node-* containers for a real Grid, each with 2 GB of shared memory. [Markdown](https://www.agentsandbox.host/p/selenium-grid-docker/index.md) - [Testcontainers for browser tests: Selenium and Playwright in throwaway containers](https://www.agentsandbox.host/p/testcontainers-browser-tests/): Testcontainers starts a browser in a throwaway Docker container from your test code and removes it afterwards. Its Selenium modules for Java, Python and Node.js hand you a WebDriver on a fresh browser; for Playwright, a generic container running the official browser server does the same. [Markdown](https://www.agentsandbox.host/p/testcontainers-browser-tests/index.md) ## Data - [Playwright vs Selenium: a sourced comparison table](https://www.agentsandbox.host/p/playwright-vs-selenium/): Playwright and Selenium are both Apache-2.0 browser automation projects. Playwright gives one API over pinned Chromium, Firefox and WebKit builds with auto-waiting and its own runner; Selenium implements W3C WebDriver in six languages and scales out with Selenium Grid. Data as of 2026-11-26: [CSV](https://www.agentsandbox.host/data/playwright-vs-selenium.csv), [JSON](https://www.agentsandbox.host/data/playwright-vs-selenium.json), [Markdown](https://www.agentsandbox.host/p/playwright-vs-selenium/index.md) ## For AI assistants - [Notes for AI assistants and crawlers](https://www.agentsandbox.host/ai/index.md): what this site is, how its facts are sourced and how to cite it - [ai.txt](https://www.agentsandbox.host/ai.txt): what AI systems may do with this site - [facts.json](https://www.agentsandbox.host/facts.json): every page, dataset and question on this site, as JSON ## About this site - [About](https://www.agentsandbox.host/about/) - [Contact](https://www.agentsandbox.host/contact/) - [Privacy](https://www.agentsandbox.host/privacy/) ## Optional - [llms-full.txt](https://www.agentsandbox.host/llms-full.txt): every article in full, as Markdown - [RSS](https://www.agentsandbox.host/rss.xml) - [Atom](https://www.agentsandbox.host/atom.xml)