npm install -g @testim/testim-cli
You can find the basic CLI of your project on the settings page.
This CLI already includes the parameters of your token and project ID.
Choose the grid you want to run on from the grid list.
Copy the CLI, edit and add parameters according to your needs.
You can run a specific test, label, configuration, etc.
Use the list below to find the different parameters you can use in your CLI.
Here is an example of running the command with the most common options (see below detailed description for all the available options):
--project: which project
--token: so we'll know it's you
--label: what tests to run
--grid: name of the grid to run the tests on
--report-file: where to put the results (so CI server could read)
testim --label "<YOUR LABEL>" --token "<YOUR ACCESS TOKEN>" --project "<YOUR PROJECT ID>" --grid "<Your grid name>" --report-file test-results/testim-tests-report.xml
--project Select which project-id to run tests from.
Tip! you can find the project-id in the IDE under settings
--token Provide your access token you got from us. If you need one please contact us: [email protected]
--label or -l Run all tests comprising one of the mentioned labels.
Note that you can also run more that one label, by adding more --label arguments
-l sanity -l custom-label2
--name or -n, specify test name to run.
Note that you can also run more that one test by name, by adding more --name arguments
--testId or -t, specify test id to run.
Note that you can also run more that one test by id, by adding more --testId arguments
--grid to specify the Selenium Grid name to use. You can use "Testim-Grid"/ your local selenium grid/ Saucelabs / Browserstuck
Note: Read here how to configure your grid.
--report-file or -r specify where to print the report (by default to the output stream). The file is in the format of JUnitXMLReporter. This is used to integrate Testim results with the CI display. Usually, you'll need to set the build config in the CI to look for that file so make sure the CLI param value and the build config are set to the same location.
To override the classname in the report file, add this parameter :
--base-url Starting URL after browser opens
test-config Specifies a configuration name (s) (browser, operating system, resolution) that will override the configuration defined for all tests in this run.
Read more here.
--test-config "1280x1024_SXGA_chrome" --test-config "1366x768_WXGA_firefox"
When you run IE11, Edge, Firefox or Safari, you'll need to add this parameter before you can run. read more here.
--suite "suite_name" --suite "suite_name2"
Test plan option specifies test plan name to run. You can run more than one plan. Since you define in the test plan the grid, test list, configuration, etc., you cannot override it from the CLI. Therefore when using --test-plan you cannot use these flags: --testId, --label, --name, --browser, --test-config, --test-config-id or --suite.
--test-plan "Test Plan Demo"
--override-execution-name "Dev Sanity"
The class name in the JUnitXML report file is Testim.io by default. To have the suite name in the class name instead, add the parameter below with no value. If you are looking to override the class name with a specific name, add it to the parameter.
--override-report-file-classname --override-report-file-classname "Regression"
The result Labels option allows you to add textual labels to your remote runs. These labels will be shown in the runs page.
Timeout time to abort the test run if a timeout has elapsed. The timeout should be in milliseconds. The default is set to 10 minutes.
How many tests should run in parallel
--config-file or -c Specify all the configuration options from external configuration File.
Place the config file in a path accessible by the shell, specify in the command the path to the file.
Read more about configuration file here.
When this flag is used, a failed test will be executed repeatedly until either the test passes or the max number of retries has been reached - in which case the test will fail.
When a test passes after one or more retries, it will be indicated in the UI as follows:
Tunnels let you run your app from an internal server/localhost and view it in an external browser.
--tunnel #default application port 80
testim --tunnel --tunnel-port <APP PORT default 80>
For more info check out: This Article
The rerun failed tests option allows you to rerun all test which failed in a suite run.
Copy the suite run id from the suite's page :
Add the --rerun-failed-by-run-id flag with the suite's run id to the CLI :
Updated 6 days ago