UiPath Documentation
uipath-cli
latest
false
UiPath CLI user guide

uip tm run

Syntax and options for `uip tm run`, which runs every test in a package already uploaded to Orchestrator, waits for the results, writes a report, and exits non-zero when a test fails.

uip tm run runs tests in Test Manager, waits for the results, and writes a report in one command built for CI. With --type package, it runs every test in a package already uploaded to Orchestrator. The exit code carries the verdict, so a pipeline step needs no extra parsing.

The command waits up to 5 minutes for Test Manager to index the uploaded package, then runs its tests through a hidden test set. Test Manager creates and links a test case for any test in the package that does not have one yet. Failed test cases are re-run up to --max-retries times within the same execution, so the report holds the last result of every test case.

Without --project-key or --project-id, the tests run in the tenant default project, the one project get-default returns. Test Manager creates that project if the tenant has none. Every result names the project the tests ran in under ProjectKey.

Synopsis​

uip tm run --type package [--project-key <key> | --project-id <id>] --package-name <name> --package-version <version> (--folder-path <path> | --folder-key <uuid>) [--input-path <file>] [--max-retries <count>] [--format <format>] [--result-path <path>] [--include-passed-assertions] [--timeout <seconds>] [--poll-interval <seconds>]
uip tm run --type package [--project-key <key> | --project-id <id>] --package-name <name> --package-version <version> (--folder-path <path> | --folder-key <uuid>) [--input-path <file>] [--max-retries <count>] [--format <format>] [--result-path <path>] [--include-passed-assertions] [--timeout <seconds>] [--poll-interval <seconds>]

Honors the global options. See Exit codes for the codes this command uses.

uip tm run​

Run every test in an uploaded package, wait for the execution to finish, and write a JUnit XML or UiPath JSON report.

Arguments​

None.

Options​

FlagDescription
--type <type>Required. What to run. Only package (a package already uploaded to Orchestrator) is accepted.
--project-key <key>Test Manager project key. Ignored if --project-id is also given. Without --project-key or --project-id, the tests run in the tenant default project; when the tenant has none, Test Manager creates it, which needs the tenant Project.Create permission.
--project-id <id>Test Manager project ID. Use instead of --project-key; wins if both are given.
--package-name <name>Required. Package ID as uploaded to Orchestrator (for example, MyTests).
--package-version <version>Required. An app version (for example, 1.0) runs its latest uploaded patch. An exact version (for example, 1.0.244878764) must already be uploaded and must be the latest patch of its app version; older patches are refused. The command waits up to 5 minutes for Test Manager to index a version Orchestrator already has.
--folder-path <path>Orchestrator folder to run the tests in (for example, Shared or Shared/CI). Exactly one of --folder-path or --folder-key is required.
--folder-key <uuid>Orchestrator folder key, instead of --folder-path.
--input-path <file>JSON file with parameter overrides, for example [{"name":"Param","type":"String","value":"v"}]. The file is read before anything is created. Names that no test declares are not applied; the output lists them under IgnoredInputs.
--max-retries <count>Re-run failed test cases up to this many times, from 0 to 100. Defaults to 0.
--format <format>Report format: junit (XML) or uipath (JSON). Defaults to junit.
--result-path <path>Report file or directory. Defaults to the current working directory. A directory, or a new path with no extension, gets a file named after the run's test set.
--include-passed-assertionsAlso read the assertions of passed tests for the report, one more request per passed test. By default only tests that did not pass get their assertions.
--timeout <seconds>Maximum seconds for the whole run, retries included; 0 means no timeout. Defaults to 7200, at most 604800 (one week).
--poll-interval <seconds>Seconds between execution status checks, from 1 to 3600. Defaults to 60.

Examples​

# run every test in MyTests 1.0.3 and write a JUnit report
uip tm run \
  --type package \
  --project-key DEMO \
  --package-name MyTests \
  --package-version 1.0.3 \
  --folder-path Shared \
  --result-path ./results/junit.xml

# run the same package in the tenant default project (no --project-key)
uip tm run \
  --type package \
  --package-name MyTests \
  --package-version 1.0.3 \
  --folder-path Shared \
  --result-path ./results/junit.xml

# run the latest 1.0.x patch with input overrides, retry failed tests twice, write the UiPath JSON report
uip tm run \
  --type package \
  --project-key DEMO \
  --package-name MyTests \
  --package-version 1.0 \
  --folder-path Shared \
  --input-path ./inputs.json \
  --max-retries 2 \
  --format uipath
# run every test in MyTests 1.0.3 and write a JUnit report
uip tm run \
  --type package \
  --project-key DEMO \
  --package-name MyTests \
  --package-version 1.0.3 \
  --folder-path Shared \
  --result-path ./results/junit.xml

# run the same package in the tenant default project (no --project-key)
uip tm run \
  --type package \
  --package-name MyTests \
  --package-version 1.0.3 \
  --folder-path Shared \
  --result-path ./results/junit.xml

# run the latest 1.0.x patch with input overrides, retry failed tests twice, write the UiPath JSON report
uip tm run \
  --type package \
  --project-key DEMO \
  --package-name MyTests \
  --package-version 1.0 \
  --folder-path Shared \
  --input-path ./inputs.json \
  --max-retries 2 \
  --format uipath

Data shape (every test passed)​

{
  "Result": "Success",
  "Code": "RunPackage",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "ExecutionUrl": "https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001",
    "PackageName": "MyTests",
    "PackageVersion": "1.0.3",
    "FolderPath": "Shared",
    "Status": "Finished",
    "TotalTests": 12,
    "Passed": 12,
    "Failed": 0,
    "Cancelled": 0,
    "Format": "junit",
    "OutputPath": "./results/junit.xml",
    "Retries": 0,
    "ProjectKey": "DEMO"
  }
}
{
  "Result": "Success",
  "Code": "RunPackage",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "ExecutionUrl": "https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001",
    "PackageName": "MyTests",
    "PackageVersion": "1.0.3",
    "FolderPath": "Shared",
    "Status": "Finished",
    "TotalTests": 12,
    "Passed": 12,
    "Failed": 0,
    "Cancelled": 0,
    "Format": "junit",
    "OutputPath": "./results/junit.xml",
    "Retries": 0,
    "ProjectKey": "DEMO"
  }
}
FieldMeaning
ExecutionUrlLink to the execution in Test Manager. Present on success and on failure.
PackageVersionThe exact version that ran, resolved from --package-version.
ProjectKeyThe project the tests ran in: the one you passed, or the tenant default project. It is the last field, so with --output plain it is the last column.
RetriesHow many re-runs of failed test cases took place.
OutputPathWhere the report was written.
IgnoredInputs, DeclaredInputsPresent only when --input-path names inputs that no test declares: the ignored names, and the names the tests do declare.
MissingResultsPresent only when Test Manager counts more tests than reported a result.
AssertionsNotReadPresent only when the assertions of some tests could not be read; the report has no failure details for them.

When the tests pass but inputs were ignored or assertions could not be read, the success envelope also carries a Warning.

Data shape (a test failed)​

{
  "Result": "Failure",
  "Code": "RunPackageTestsFailed",
  "ErrorCode": "execution_failed",
  "Message": "2 of 12 tests did not pass (2 failed).",
  "Instructions": "See the report at ./results/junit.xml or open https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001.",
  "Retry": "RetryWillNotFix",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "ExecutionUrl": "https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001",
    "PackageName": "MyTests",
    "PackageVersion": "1.0.3",
    "FolderPath": "Shared",
    "Status": "Finished",
    "TotalTests": 12,
    "Passed": 10,
    "Failed": 2,
    "Cancelled": 0,
    "Format": "junit",
    "OutputPath": "./results/junit.xml",
    "Retries": 0,
    "ProjectKey": "DEMO"
  }
}
{
  "Result": "Failure",
  "Code": "RunPackageTestsFailed",
  "ErrorCode": "execution_failed",
  "Message": "2 of 12 tests did not pass (2 failed).",
  "Instructions": "See the report at ./results/junit.xml or open https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001.",
  "Retry": "RetryWillNotFix",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "ExecutionUrl": "https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001",
    "PackageName": "MyTests",
    "PackageVersion": "1.0.3",
    "FolderPath": "Shared",
    "Status": "Finished",
    "TotalTests": 12,
    "Passed": 10,
    "Failed": 2,
    "Cancelled": 0,
    "Format": "junit",
    "OutputPath": "./results/junit.xml",
    "Retries": 0,
    "ProjectKey": "DEMO"
  }
}

Data holds the same run summary as on success, with the same fields in the same order. Only the envelope around it differs:

Envelope fieldEvery test passedA test failed
ResultSuccessFailure
CodeRunPackageRunPackageTestsFailed, or RunPackageCancelled for a cancelled execution
ErrorCode, Message, Instructions, RetryAbsentPresent. Instructions names the report path and the execution link.
Exit code01

To link a CI run to its results in Test Manager, read Data.ExecutionUrl. It is present whether the tests passed or failed. The report is written in both cases.

Data shape (timeout)​

{
  "Result": "TimeoutError",
  "ErrorCode": "timeout",
  "Message": "Timed out while waiting for the tests.",
  "Instructions": "The tests may still be running. Check execution a1b2c3d4-0000-0000-0000-000000000001 in Test Manager, or run again with a larger --timeout. A report of the tests that finished is at ./results/junit.xml.",
  "Retry": "RetryLater",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "Retries": 0,
    "OutputPath": "./results/junit.xml",
    "ProjectKey": "DEMO",
    "ExecutionUrl": "https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001"
  }
}
{
  "Result": "TimeoutError",
  "ErrorCode": "timeout",
  "Message": "Timed out while waiting for the tests.",
  "Instructions": "The tests may still be running. Check execution a1b2c3d4-0000-0000-0000-000000000001 in Test Manager, or run again with a larger --timeout. A report of the tests that finished is at ./results/junit.xml.",
  "Retry": "RetryLater",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "Retries": 0,
    "OutputPath": "./results/junit.xml",
    "ProjectKey": "DEMO",
    "ExecutionUrl": "https://cloud.uipath.com/org/tenant/testmanager_/DEMO/testexecutions/a1b2c3d4-0000-0000-0000-000000000001"
  }
}

Data is present only when the execution had started before the time ran out. OutputPath is present only when a partial report of the tests that finished could be written. ProjectKey and ExecutionUrl locate the started execution. Any other failure after the execution starts carries the same Data fields.

Exit codes​

Exit codeMeaning
0Every test passed.
1A test failed or reported no result, the run was cancelled, no test ran, or a service call failed.
2Login or permission problem after the run starts, or no permission to open or create the tenant default project. A missing login or no access to a project you passed exits 1 before the run starts.
3Bad option or input, for example no folder or both folder flags, an invalid --package-version, or a malformed --input-path file.
4--timeout elapsed.

Exit code 1 covers several outcomes. To tell them apart, read the envelope: Code is RunPackageCancelled for a cancelled run and RunPackageTestsFailed otherwise, Data.TotalTests is 0 when no test ran (for example, an empty or mis-specified package), and Data.MissingResults counts tests that reported no result. The missing-login case differs from the CLI-wide rule that authentication errors exit 2; see Exit codes.

Unlike uip tm wait, which exits 0 once an execution finishes whatever its results, uip tm run fails the step itself when a test does not pass.

  • uip or packages — packages upload publishes the package this command runs.
  • project get-default — the tenant default project this command runs in when you pass no project.
  • pack — build a .nupkg from an external Playwright test project.
  • testsets run — start a run of an existing test set instead.
  • executions — inspect, retry, or cancel the execution this command starts.
  • result — download JUnit XML for any execution.

See also​

Was this page helpful?

Connect

Need help? Support(opens in new window)

Want to learn? UiPath Academy(opens in new window)

Have questions? UiPath Forum(opens in new window)

Stay updated