Testim Documentation

Welcome to the Testim documentation. You'll find comprehensive guides to help you get started quickly, example code snippets, and tips for being more productive. You will also find details about advanced features that allow you to customize Testim to fit your environment or special testing conditions. Don't worry, we'll support you if you get stuck. Let's jump right in!

Guides    Changelog

Running on a Selenium Grid

🚧

TDK Feature

This is not supported in Testim's visual editor.

Testim supports running your code in the following ways:

  • Locally - in this case, Testim will automatically install a driver for Chrome and run your code.
  • Remotely - on a selenium Grid.

It is technically possible to run your tests in a Chrome instance directly in your CI and indeed doing so with Testim will work. We do not recommend it because while it has some advantages like reducing latency - your CI server is not aware of how much resources the browser uses. This means that it does not scale and it generally provides an inferior experience than using a proper browser grid.

We recommend running your tests on a Selenium grid. Note that this does not mean that Testim will run your tests with Selenium necessarily - only that Selenium Grid is the method used in order to control starting and stopping the browser and the test.

Actual Technical How-To

The easiest option would be to run:

npm run ci

In your Testim Code generated project. This will automatically look for a grid called testim-grid which you can configure from the Testim UI. This also integrates with third-party grids seamlessly like Saucelabs or BrowserStack.

Alternatively, you can run Testim Code on a grid by passing the --host and --port options. For example, running a test locally on Firefox can be done with:

# webdriver manager is installed from npm
$ webdriver-manager start &
$ testim -f ./test.js --host localhost --port 4444 -b firefox

You can pass any valid Selenium grid here. Note that this implies that the grid needs to be reachable from your browser.

More examples

# grid name - preferred and more maintainable
$ testim -f ./tests/*.js --grid testim-grid
# grid host and port - also supported
$ testim -f ./tests/*.js --host http://example.com/grid --port 4444 
# local grid assuming webdriver-manager is running
$ testim -f ./test.js --host 127.0.0.1 --port 4444

Updated 6 months ago

Running on a Selenium Grid


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.