How to Run Testplane in a Local Browser
Introduction
Testplane can automatically download browsers in accordance with your Testplane Config.
Additionally, if Testplane is used on a supported version of Ubuntu, the necessary deb packages for running browsers will also be downloaded in a similar manner.
Running tests on a local browser can help with troubleshooting a problem that occurs when running on a remote grid, but using local browsers for screenshot testing is not recommended, as screenshots will vary depending on the operating system version.
Installing dependencies
In a project with Testplane, you can execute the command npx testplane install-deps
. This command will download the necessary browsers (chrome
and firefox
) and their web drivers (chrome
, firefox
, and edge
).
You can also download only the necessary browsers described in the config. For example, if the browser chrome-dark
is described, you can download only this one with the command `npm testplane install-deps chrome-dark'.
You can read more about this command on the respective page: install-deps
Running tests
You can run tests on local browsers using the CLI option --local
, or with gridUrl: "local" in the Testplane config. For example:
npx testplane --local
This way, the corresponding web driver processes for supported browsers will be automatically started, and Testplane will use these locally launched drivers with locally downloaded browsers.
If necessary, browsers will be downloaded before the test run, so running the install-deps
command separately is not mandatory, especially if you want to quickly run a test in just one browser.
Debugging tests
When debug
is enabled in the config, web driver logs with a prefix will be output to stdout/stderr:
export default {
// ... other Testplane settings
system: {
debug: true,
},
};
To reduce excessive webdriverio
logs, you can set the desired level for the WDIO_LOG_LEVEL
environment variable.
For example, here's how a launch would look with debugging enabled via an environment variable, webdriverio
logging level set to error
in a local browser with browserId chrome
in the config:
testplane_system_debug=true WDIO_LOG_LEVEL=error npx testplane --local -b chrome
And the web driver logs will look something like this:
$ testplane_system_debug=true WDIO_LOG_LEVEL=error npx testplane --local -b chrome
[chromedriver@130] Starting ChromeDriver 130.0.6723.116 (6ac35f94ae3d01152cf1946c896b0678e48f8ec4-refs/branch-heads/6723@{#1764}) on port 43415
[chromedriver@130] Only local connections are allowed.
[chromedriver@130] Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[chromedriver@130] ChromeDriver was started successfully on port 43415.
Browser support
Here is the table of supported browsers:
Browser | Auto download | Auto driver download | Running webdriver |
---|---|---|---|
Chrome | + | + | + |
Firefox | + | + | + |
Edge | - | + | + |
Safari | - | + | + |
Supported browser versions per OS:
OS | Windows | MacOs | Ubuntu 20 | Ubuntu 22 | Ubuntu 24 |
---|---|---|---|---|---|
Chrome | 73+ | 73+ | 73+ | 73+ | 73+ |
Firefox | 60+ | 60+ | 60+ | 91+ | 126+ |
Edge | * | * | * | * | * |
Safari | - | * | - | - | - |
-
- Browser auto download is not supported, but if the browser is installed by the user himself, installed version will be used by Testplane.
For virtual environments, you would need to run headless. "--no-sandbox" CLI arg for "chrome" browser could also be necessary:
{
// other chrome browser settings
headless: true,
desiredCapabilities: {
browserName: "chrome",
browserVersion: "130.0",
"goog:chromeOptions": { args: ["--no-sandbox"] }
}
}