{
  "site": {
    "name": "AgentSandbox.host",
    "url": "https://www.agentsandbox.host/",
    "description": "Browser testing at scale with Playwright and Selenium: setup in Python and Node.js, Docker images, Selenium Grid, parallel runs, sharding and flaky tests.",
    "language": "en"
  },
  "updated": "2026-11-26",
  "how_to_use": [
    "To cite this site, give the page's title, its address and its last-updated date.",
    "Figures in data tables carry their source and the day they were checked, row by row. A figure repeated without that day is out of date by default.",
    "Do not attribute to this site words or figures it did not publish."
  ],
  "pages": [
    {
      "title": "How to fix flaky browser tests in Playwright and Selenium",
      "url": "https://www.agentsandbox.host/p/fix-flaky-browser-tests/",
      "markdown": "https://www.agentsandbox.host/p/fix-flaky-browser-tests/index.md",
      "type": "article",
      "summary": "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.",
      "author": "AgentSandbox.host editors",
      "published": "2026-11-26",
      "updated": "2026-11-26"
    },
    {
      "title": "Playwright CLI: every command and the test options that matter",
      "url": "https://www.agentsandbox.host/p/playwright-cli-commands/",
      "markdown": "https://www.agentsandbox.host/p/playwright-cli-commands/index.md",
      "type": "article",
      "summary": "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.",
      "author": "AgentSandbox.host editors",
      "published": "2026-11-26",
      "updated": "2026-11-26"
    },
    {
      "title": "Playwright async in Python: when to use it and how",
      "url": "https://www.agentsandbox.host/p/playwright-python-async/",
      "markdown": "https://www.agentsandbox.host/p/playwright-python-async/index.md",
      "type": "article",
      "summary": "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.",
      "author": "AgentSandbox.host editors",
      "published": "2026-11-26",
      "updated": "2026-11-26"
    },
    {
      "title": "Playwright with Python: install it and write your first test",
      "url": "https://www.agentsandbox.host/p/playwright-python-tutorial/",
      "markdown": "https://www.agentsandbox.host/p/playwright-python-tutorial/index.md",
      "type": "article",
      "summary": "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.",
      "author": "AgentSandbox.host editors",
      "published": "2026-11-26",
      "updated": "2026-11-26"
    },
    {
      "title": "Playwright testing with Node.js: install, first test, config",
      "url": "https://www.agentsandbox.host/p/playwright-testing-with-node/",
      "markdown": "https://www.agentsandbox.host/p/playwright-testing-with-node/index.md",
      "type": "article",
      "summary": "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.",
      "author": "AgentSandbox.host editors",
      "published": "2026-11-26",
      "updated": "2026-11-26"
    },
    {
      "title": "Playwright vs Selenium: a sourced comparison table",
      "url": "https://www.agentsandbox.host/p/playwright-vs-selenium/",
      "markdown": "https://www.agentsandbox.host/p/playwright-vs-selenium/index.md",
      "type": "data",
      "summary": "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.",
      "author": "AgentSandbox.host editors",
      "published": "2026-11-26",
      "updated": "2026-11-26"
    },
    {
      "title": "Run browser tests in parallel: workers on one machine, shards across many",
      "url": "https://www.agentsandbox.host/p/run-browser-tests-in-parallel/",
      "markdown": "https://www.agentsandbox.host/p/run-browser-tests-in-parallel/index.md",
      "type": "article",
      "summary": "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.",
      "author": "AgentSandbox.host editors",
      "published": "2026-11-26",
      "updated": "2026-11-26"
    },
    {
      "title": "Run Playwright tests in Docker with the official image",
      "url": "https://www.agentsandbox.host/p/run-playwright-tests-in-docker/",
      "markdown": "https://www.agentsandbox.host/p/run-playwright-tests-in-docker/index.md",
      "type": "article",
      "summary": "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.",
      "author": "AgentSandbox.host editors",
      "published": "2026-11-26",
      "updated": "2026-11-26"
    },
    {
      "title": "Selenium Grid: what it is and how to run it in Docker",
      "url": "https://www.agentsandbox.host/p/selenium-grid-docker/",
      "markdown": "https://www.agentsandbox.host/p/selenium-grid-docker/index.md",
      "type": "article",
      "summary": "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.",
      "author": "AgentSandbox.host editors",
      "published": "2026-11-26",
      "updated": "2026-11-26"
    },
    {
      "title": "Testcontainers for browser tests: Selenium and Playwright in throwaway containers",
      "url": "https://www.agentsandbox.host/p/testcontainers-browser-tests/",
      "markdown": "https://www.agentsandbox.host/p/testcontainers-browser-tests/index.md",
      "type": "article",
      "summary": "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.",
      "author": "AgentSandbox.host editors",
      "published": "2026-11-26",
      "updated": "2026-11-26"
    }
  ],
  "datasets": [
    {
      "name": "Playwright vs Selenium: a sourced comparison table",
      "url": "https://www.agentsandbox.host/p/playwright-vs-selenium/",
      "csv": "https://www.agentsandbox.host/data/playwright-vs-selenium.csv",
      "json": "https://www.agentsandbox.host/data/playwright-vs-selenium.json",
      "as_of": "2026-11-26"
    }
  ],
  "questions": [
    {
      "question": "What is a flaky test?",
      "answer": "A flaky test passes and fails on the same code. Playwright Test labels a test flaky when it failed on the first run but passed when retried.",
      "url": "https://www.agentsandbox.host/p/fix-flaky-browser-tests/"
    },
    {
      "question": "Should I just turn on retries?",
      "answer": "Retries keep a pipeline moving, but they hide the cause. Turn them on with tracing on the first retry, read the traces, and fix the tests that keep showing up as flaky. --fail-on-flaky-tests stops flaky passes from counting as green.",
      "url": "https://www.agentsandbox.host/p/fix-flaky-browser-tests/"
    },
    {
      "question": "How do I reproduce a flaky Playwright test locally?",
      "answer": "Run it many times in a row with npx playwright test --repeat-each=20, optionally with --workers set to match the CI machine, and record a trace with --trace on.",
      "url": "https://www.agentsandbox.host/p/fix-flaky-browser-tests/"
    },
    {
      "question": "Why are my browser tests flaky only on CI?",
      "answer": "CI machines often have fewer cores, so the same number of parallel browsers renders pages later than on a laptop and timing assumptions break. Lower the workers, or check whether the failures come from the environment rather than the tests.",
      "url": "https://www.agentsandbox.host/p/fix-flaky-browser-tests/"
    },
    {
      "question": "How do I avoid flaky waits in Selenium?",
      "answer": "Replace sleeps with explicit waits for a specific condition, keep the implicit wait at its default of 0, and never mix implicit and explicit waits.",
      "url": "https://www.agentsandbox.host/p/fix-flaky-browser-tests/"
    },
    {
      "question": "How do I run a single Playwright test from the command line?",
      "answer": "Pass the file and line, npx playwright test example.spec.ts:10, or a title pattern with -g, npx playwright test -g \"add a todo item\".",
      "url": "https://www.agentsandbox.host/p/playwright-cli-commands/"
    },
    {
      "question": "How do I list Playwright tests without running them?",
      "answer": "Run npx playwright test --list. It collects all tests and reports them without running any.",
      "url": "https://www.agentsandbox.host/p/playwright-cli-commands/"
    },
    {
      "question": "What is the default Playwright test timeout?",
      "answer": "30 seconds per test. Change it with --timeout in milliseconds, or the timeout option in the config. --global-timeout caps the whole run and is unlimited by default.",
      "url": "https://www.agentsandbox.host/p/playwright-cli-commands/"
    },
    {
      "question": "How do I install only Chromium for Playwright?",
      "answer": "Run npx playwright install --with-deps chromium. For headless-only runs, npx playwright install --with-deps --only-shell installs the smaller headless shell instead of full Chromium.",
      "url": "https://www.agentsandbox.host/p/playwright-cli-commands/"
    },
    {
      "question": "Is there a Playwright CLI for coding agents?",
      "answer": "Yes. Since release 1.62 the playwright package bundles playwright-cli and the Playwright MCP server, run as npx playwright cli and npx playwright mcp.",
      "url": "https://www.agentsandbox.host/p/playwright-cli-commands/"
    },
    {
      "question": "Is Playwright's async API faster than the sync API in Python?",
      "answer": "Not for one page. Both drive the same browser. Async helps when one process must drive several pages or browsers at the same time, because the waits overlap instead of running one after another.",
      "url": "https://www.agentsandbox.host/p/playwright-python-async/"
    },
    {
      "question": "Can I use Playwright from several threads?",
      "answer": "Playwright's API is not thread-safe. Its documentation says to create a Playwright instance per thread if you use threads. With asyncio you can run many pages concurrently in a single thread instead.",
      "url": "https://www.agentsandbox.host/p/playwright-python-async/"
    },
    {
      "question": "Why does Playwright fail with NotImplementedError on Windows?",
      "answer": "Playwright needs asyncio's ProactorEventLoop on Windows, because the SelectorEventLoop does not support async subprocesses. Do not switch the event loop policy to the selector loop in code that starts Playwright.",
      "url": "https://www.agentsandbox.host/p/playwright-python-async/"
    },
    {
      "question": "How do I write async Playwright tests with pytest?",
      "answer": "Install pytest-playwright-asyncio, use pytest-asyncio 0.26.0 or newer, set asyncio_default_test_loop_scope = session in your pytest configuration, and decorate each test with @pytest.mark.asyncio(loop_scope=\"session\").",
      "url": "https://www.agentsandbox.host/p/playwright-python-async/"
    },
    {
      "question": "What Python version does Playwright need?",
      "answer": "The current playwright package on PyPI (1.65.2 when we checked on 26 November 2026) declares Python 3.10 or newer. The getting-started page still says 3.8 or higher, so go by the package's own requirement.",
      "url": "https://www.agentsandbox.host/p/playwright-python-tutorial/"
    },
    {
      "question": "Do I need pytest to use Playwright in Python?",
      "answer": "No. The playwright package works as a plain library with a sync or async API. The pytest plugin, pytest-playwright, is the recommended way to write end-to-end tests because it gives each test a fresh page and context.",
      "url": "https://www.agentsandbox.host/p/playwright-python-tutorial/"
    },
    {
      "question": "Why does my Playwright test not open a browser window?",
      "answer": "Tests run headless by default, so no window opens. Run pytest --headed to see the browser.",
      "url": "https://www.agentsandbox.host/p/playwright-python-tutorial/"
    },
    {
      "question": "How do I run Playwright tests in Firefox or WebKit from Python?",
      "answer": "Pass --browser firefox or --browser webkit to pytest. The option can be given more than once to run the same tests in several browsers.",
      "url": "https://www.agentsandbox.host/p/playwright-python-tutorial/"
    },
    {
      "question": "How do I update Playwright in a Python project?",
      "answer": "Run pip install pytest-playwright playwright -U, then playwright install again so the browser builds match the new version.",
      "url": "https://www.agentsandbox.host/p/playwright-python-tutorial/"
    },
    {
      "question": "Which Node.js versions does Playwright support?",
      "answer": "Playwright's installation page lists the latest 22.x, 24.x and 26.x releases. The @playwright/test package itself (1.65.1 when we checked) declares Node.js 20 or newer as its engine.",
      "url": "https://www.agentsandbox.host/p/playwright-testing-with-node/"
    },
    {
      "question": "What is the difference between playwright and @playwright/test?",
      "answer": "The playwright package is Playwright Library, which gives the APIs to launch and drive browsers. The @playwright/test package is Playwright Test, which adds a managed test runner with fixtures and assertions. Install the library for scripts and @playwright/test for tests.",
      "url": "https://www.agentsandbox.host/p/playwright-testing-with-node/"
    },
    {
      "question": "How many tests does Playwright run at once?",
      "answer": "By default Playwright Test uses worker processes up to half the number of logical CPU cores. Set workers in the config or pass --workers to change it.",
      "url": "https://www.agentsandbox.host/p/playwright-testing-with-node/"
    },
    {
      "question": "How do I see the browser while a test runs?",
      "answer": "Run npx playwright test --headed, or npx playwright test --ui for the interactive UI mode, or npx playwright test --debug to step through with the Inspector.",
      "url": "https://www.agentsandbox.host/p/playwright-testing-with-node/"
    },
    {
      "question": "Is Playwright faster than Selenium?",
      "answer": "Neither project publishes a speed comparison, and run time depends far more on your pages, waits and parallelism than on the library. What differs by design is waiting, which Playwright does before every action and Selenium leaves to waits you write, and parallelism, which Playwright Test runs in worker processes out of the box.",
      "url": "https://www.agentsandbox.host/p/playwright-vs-selenium/"
    },
    {
      "question": "Which languages do Playwright and Selenium support?",
      "answer": "Playwright supports JavaScript and TypeScript, Python, Java and .NET. Selenium's official bindings are Java, Python, C#, Ruby, JavaScript and Kotlin.",
      "url": "https://www.agentsandbox.host/p/playwright-vs-selenium/"
    },
    {
      "question": "Can Playwright test Safari?",
      "answer": "Playwright tests WebKit, the engine behind Safari, on Linux, macOS and Windows. Selenium drives the Safari browser itself through its driver.",
      "url": "https://www.agentsandbox.host/p/playwright-vs-selenium/"
    },
    {
      "question": "Do I need Selenium Grid to run tests in parallel?",
      "answer": "Not on one machine; your test framework can run several sessions at once. Selenium Grid is for running sessions on remote machines and across browser versions and platforms.",
      "url": "https://www.agentsandbox.host/p/playwright-vs-selenium/"
    },
    {
      "question": "Should I migrate from Selenium to Playwright?",
      "answer": "Only with a reason the table supports, such as flaky waits, WebKit coverage or wanting a built-in runner. A large, stable Selenium suite on a working Grid keeps its value; mixed languages such as Ruby or Kotlin have no official Playwright binding.",
      "url": "https://www.agentsandbox.host/p/playwright-vs-selenium/"
    },
    {
      "question": "How many Playwright workers should I use?",
      "answer": "Start from the default, half the logical CPU cores, and lower it if tests time out under load. Playwright recommends one worker on CI machines for stability and reproducibility; to finish sooner there, shard the suite across machines.",
      "url": "https://www.agentsandbox.host/p/run-browser-tests-in-parallel/"
    },
    {
      "question": "What is the difference between workers and shards in Playwright?",
      "answer": "Workers are processes on one machine, each with its own browser. Shards split the test list across separate runs, usually on separate machines; each shard then uses its own workers.",
      "url": "https://www.agentsandbox.host/p/run-browser-tests-in-parallel/"
    },
    {
      "question": "Why are my Playwright shards uneven?",
      "answer": "Without fullyParallel, Playwright shards whole files, so one large file lands on one shard. Set fullyParallel true to split by test, or keep files small and similar in size.",
      "url": "https://www.agentsandbox.host/p/run-browser-tests-in-parallel/"
    },
    {
      "question": "How do I run pytest Playwright tests in parallel?",
      "answer": "Install pytest-xdist and run pytest --numprocesses auto, which starts one process per physical CPU core. Use -n logical to count logical cores instead.",
      "url": "https://www.agentsandbox.host/p/run-browser-tests-in-parallel/"
    },
    {
      "question": "Which Playwright Docker image tag should I use?",
      "answer": "The tag whose version matches the @playwright/test or playwright version in your lock file, on the Ubuntu base you want. For 1.65.1 that is v1.65.1-noble (Ubuntu 24.04) or v1.65.1-jammy (Ubuntu 22.04).",
      "url": "https://www.agentsandbox.host/p/run-playwright-tests-in-docker/"
    },
    {
      "question": "Why does Chromium crash in the Playwright Docker image?",
      "answer": "Usually because the container's shared memory is too small. Playwright recommends --ipc=host for Chromium; without it, Chromium can run out of memory and crash.",
      "url": "https://www.agentsandbox.host/p/run-playwright-tests-in-docker/"
    },
    {
      "question": "Does the Playwright Docker image include Playwright?",
      "answer": "No. The image includes Node.js, the browsers and their system dependencies, but the Playwright package must be installed from your project, for example with npm ci.",
      "url": "https://www.agentsandbox.host/p/run-playwright-tests-in-docker/"
    },
    {
      "question": "Is there a Playwright image for Python?",
      "answer": "Yes. The Python image is published as mcr.microsoft.com/playwright/python with the same version tags, such as v1.65.2-noble.",
      "url": "https://www.agentsandbox.host/p/run-playwright-tests-in-docker/"
    },
    {
      "question": "Can I run headed tests in the Playwright image?",
      "answer": "Yes. Playwright's CI guide says headed runs on Linux need Xvfb and that the Playwright Docker image includes it, so prefix the command with xvfb-run.",
      "url": "https://www.agentsandbox.host/p/run-playwright-tests-in-docker/"
    },
    {
      "question": "What port does Selenium Grid use?",
      "answer": "Tests connect on port 4444, which also serves the Grid UI. In a Hub and Node setup the Event Bus uses ports 4442 and 4443, which must be reachable from every Node.",
      "url": "https://www.agentsandbox.host/p/selenium-grid-docker/"
    },
    {
      "question": "Why do Selenium Docker images need --shm-size=2g?",
      "answer": "Browsers crash in a container whose shared memory is too small. The docker-selenium project calls 2 GB a known workaround that is arbitrary but known to work well, and says to tune it for your workload.",
      "url": "https://www.agentsandbox.host/p/selenium-grid-docker/"
    },
    {
      "question": "How many browsers can one Selenium Node container run?",
      "answer": "One session by default, set by SE_NODE_MAX_SESSIONS. It can be raised up to the number of available processors; going higher needs SE_NODE_OVERRIDE_MAX_SESSIONS=true, and the project advises against more sessions than processors.",
      "url": "https://www.agentsandbox.host/p/selenium-grid-docker/"
    },
    {
      "question": "Do Selenium Docker images run on arm64?",
      "answer": "Yes, from image tag 4.21.0 onwards for amd64 and arm64. Chrome, Chromium and Firefox images are multi-arch; Edge and Chrome for Testing images are amd64 only.",
      "url": "https://www.agentsandbox.host/p/selenium-grid-docker/"
    },
    {
      "question": "How do I watch a test running inside a Selenium container?",
      "answer": "Publish port 7900 and open it in a browser; the docker-selenium README gives the password secret.",
      "url": "https://www.agentsandbox.host/p/selenium-grid-docker/"
    },
    {
      "question": "What is Testcontainers?",
      "answer": "Testcontainers is an open-source library, available for Java, Python, Node.js and other languages, that starts Docker containers from test code and cleans them up when the test ends. It is used for databases, message brokers and browsers.",
      "url": "https://www.agentsandbox.host/p/testcontainers-browser-tests/"
    },
    {
      "question": "Does Testcontainers have a Playwright module?",
      "answer": "The official Selenium modules cover WebDriver. For Playwright, start the official Playwright image as a generic container running Playwright's browser server, and connect to it from your test.",
      "url": "https://www.agentsandbox.host/p/testcontainers-browser-tests/"
    },
    {
      "question": "How does a browser in a Testcontainers container reach my app on localhost?",
      "answer": "Expose the app's port to containers with exposeHostPorts, then open host.testcontainers.internal and that port from the browser. Both the Java and Node.js libraries document this.",
      "url": "https://www.agentsandbox.host/p/testcontainers-browser-tests/"
    },
    {
      "question": "Can Testcontainers record a video of a browser test?",
      "answer": "Yes. The Java module records with withRecordingMode, for all tests or only failing ones, and the Node.js Selenium module records with withRecording and saveRecording.",
      "url": "https://www.agentsandbox.host/p/testcontainers-browser-tests/"
    }
  ],
  "machine_readable": [
    {
      "name": "llms.txt",
      "url": "https://www.agentsandbox.host/llms.txt"
    },
    {
      "name": "llms-full.txt",
      "url": "https://www.agentsandbox.host/llms-full.txt"
    },
    {
      "name": "facts.json",
      "url": "https://www.agentsandbox.host/facts.json"
    },
    {
      "name": "ai.txt",
      "url": "https://www.agentsandbox.host/ai.txt"
    },
    {
      "name": "Sitemap",
      "url": "https://www.agentsandbox.host/sitemap.xml"
    },
    {
      "name": "RSS",
      "url": "https://www.agentsandbox.host/rss.xml"
    },
    {
      "name": "Atom",
      "url": "https://www.agentsandbox.host/atom.xml"
    }
  ]
}
