Running tests with a TR Test Agent
Running tests with a TR Test Agent
Install the agent on your machine or CI runner, run an approved test on an environment and read the step-by-step results.
- 1RetiredRemote TR Test Agents were retired on 19 November 2026: tests run in Test Studio Desktop on your computer. The steps below describe how agents worked, for runs made with them.
- 2Prepare the machineInstall Node 18 or later. In a folder, run npm i playwright and npx playwright install chromium (add firefox or webkit if you want those browsers). Google Chrome and Microsoft Edge use the browsers already installed.
- 3Add the agentTest Studio → Runs → TR Test Agents → Add agent (Test Studio managers). Copy the token and key straight away: they are shown once.
- 4Start itDownload tr-test-agent.mjs from the same panel and run TR_TEST_AGENT_TOKEN=… TR_TEST_AGENT_KEY=… node tr-test-agent.mjs. Add TR_BROWSERS=chromium,firefox to offer more browsers and TR_CONCURRENCY=2 to run two tests at once. It shows as online within a minute.
- 5Give it the secretsTest data marked as a secret is never sent to the agent. Set it on that machine as TR_<NAME>, for example TR_PASSWORD. Uploads need TR_UPLOAD_DIR, a folder of test files.
- 6Run a testOpen an approved test case, choose the environment, browser, agent and retries, and press Run. Only approved versions run, and a production environment must be authorised first.
- 7Read the resultThe run shows every step as passed, failed, skipped (manual) or not run, with timings, the error and a screenshot of the failing step, plus console errors and failed requests.
Tips & tricks
- The agent checks each job’s signature and expiry, and refuses anything else. It only lets the page open the environment’s allowed hosts.
- A failing check isn’t retried; an agent error (the browser couldn’t start, the agent went offline) is retried up to the run’s retry limit.
- Use TR_ONCE=1 in CI: the agent finishes its current work and exits.
- Cancel a queued or running run from its page; the agent stops before the next step.