- Overview
- Get started
- Concepts
- Using UiPath CLI
- How-to guides
- CI/CD recipes
- Command reference
- Overview
- Exit codes
- Global options
- uip codedagent
- uip coder
- uip context-grounding
- uip docsai
- uip function
- uip guardrails
- uip llm-configuration
- uip llm-gateway
- uip maestro authoring
- uip maestro registry
- uip model-hub
- uip ont
- activities find
- activities get-default-xaml
- analyze
- analyzer-rules list
- build
- cleanup
- data-fabric-entities install
- data-fabric-entities list
- files diff
- get-library-object-repository
- get-object-repository
- init
- instances list
- pack
- packages inspect
- packages install
- packages versions
- publish
- remote
- restore
- run, debug & execution
- settings
- studio start
- templates search
- test-data add-entity
- test-data add-queue
- test-data add-variation
- tm
- uia
- validate
- workflow-examples get
- workflow-examples list
- uip resources
- uip tasks
- uip traces
- uip traces feedback
- Migration
- Reference & support
uip tm run
Syntax and options for `uip tm run`, which runs every test in a local RPA test project or 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 either packs and uploads a local RPA test project and runs every test in it, or 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.
The command deletes the hidden test set when the run finishes. It keeps the test set when the command stops while the execution may still be running, for example on a timeout. If every test passes but the test set cannot be deleted, the command fails and names the test set to delete.
With --project-path, the command packs the project as a test package and uploads it to the package feed of the folder before the run. Packing uses the rpa tool, which the CLI installs on first use. The project output type must be Process or Tests. PackageName in the output is the ID that the packed package carries: for a Process project, <project name>_Tests. Unless you pass --package-version, every run packs a new version: the major and minor of projectVersion in project.json, with the seconds since January 1, 2019 (UTC) as the patch, for example 1.0.244878764.
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>] (--project-path <path> [--package-version <version>] | --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>] (--project-path <path> [--package-version <version>] | --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 a local RPA test project or in an uploaded package, wait for the execution to finish, and write a JUnit XML or UiPath JSON report.
Arguments
None.
Options
| Flag | Description |
|---|---|
--type <type> | Required. What to run. Only package (a local project or 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. |
--project-path <path> | Local RPA test project to pack and upload before the run: the project directory, its project.json, or its project.uiproj. Pass this or --package-name with --package-version. Cannot be combined with --package-name. |
--package-name <name> | Package ID as uploaded to Orchestrator (for example, MyTests). Required, together with --package-version, when --project-path is not passed. |
--package-version <version> | For an uploaded package: 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. With --project-path: optional, the full version to pack (for example, 1.0.244878764); it must not exist in the feed yet. |
--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-assertions | Also 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
# pack, upload, and run every test in a local RPA test project
uip tm run \
--type package \
--project-key DEMO \
--project-path ./MyTests/project.json \
--folder-path Shared \
--result-path ./results/junit.xml
# 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
# pack, upload, and run every test in a local RPA test project
uip tm run \
--type package \
--project-key DEMO \
--project-path ./MyTests/project.json \
--folder-path Shared \
--result-path ./results/junit.xml
# 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"
}
}
| Field | Meaning |
|---|---|
ExecutionUrl | Link to the execution in Test Manager. Present on success and on failure. |
PackageVersion | The exact version that ran, resolved from --package-version. |
ProjectKey | The 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. |
Retries | How many re-runs of failed test cases took place. |
OutputPath | Where the report was written. |
IgnoredInputs, DeclaredInputs | Present only when --input-path names inputs that no test declares: the ignored names, and the names the tests do declare. |
MissingResults | Present only when Test Manager counts more tests than reported a result. |
AssertionsNotRead | Present 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 field | Every test passed | A test failed |
|---|---|---|
Result | Success | Failure |
Code | RunPackage | RunPackageTestsFailed, or RunPackageCancelled for a cancelled execution |
ErrorCode, Message, Instructions, Retry | Absent | Present. Instructions names the report path and the execution link. |
| Exit code | 0 | 1 |
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.
As soon as the execution starts, before the tests finish, the command also prints the link on stderr as Execution started: <link>. With --log-file, the line goes to the file. --log-level error turns it off.
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 code | Meaning |
|---|---|
0 | Every test passed. |
1 | A test failed or reported no result, the run was cancelled, no test ran, or a service call failed. |
2 | Login or permission problem after the run starts, no permission to open or create the tenant default project, or no permission to upload the package packed from --project-path. A missing login or no access to a project you passed exits 1 before the run starts. |
3 | Bad option or input, for example no folder or both folder flags, neither --project-path nor both package options, an invalid --package-version, a malformed --input-path file, a --project-path that is not an RPA project with output type Process or Tests, a project that fails to pack, or a packed version that already exists in the feed. |
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.
uip tm wait applies a similar rule to an execution started by another command: it exits 1 when a test failed or the run was cancelled. Unlike uip tm run, it does not fail on tests that reported no result.
Related
- uip or packages —
packages uploadpublishes the package this command runs when you pass--package-name. - project get-default — the tenant default project this command runs in when you pass no project.
- pack — build a
.nupkgfrom 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.