UiPath Documentation
uipath-cli
latest
false

UiPath CLI user guide

uip tm attachment

uip tm attachment downloads and uploads files associated with test case logs in a test execution — screenshots, serialized state, recorded logs, any file the automation attached to a log.

Synopsis

uip tm attachment download --execution-id <uuid> (--project-key <key> | --test-set-key <key>)
                           [--test-case-name <name>][--only-failed] [--result-path <path>]

uip tm attachment upload --object-id <uuid> --object-type <type> --file <path>
                         [--project-key <key>] [--test-set-key <key>]
                         [--source <source>] [--attachment-type <type>]
uip tm attachment download --execution-id <uuid> (--project-key <key> | --test-set-key <key>)
                           [--test-case-name <name>]… [--only-failed] [--result-path <path>]

uip tm attachment upload --object-id <uuid> --object-type <type> --file <path>
                         [--project-key <key>] [--test-set-key <key>]
                         [--source <source>] [--attachment-type <type>]

All verbs honor the global options and the standard exit codes. Every verb accepts -t, --tenant <name> and --log-level <level> (default Information).

uip tm attachment download

Download attachments for the test case logs of a single execution. The command pages through the logs, optionally narrows to failed-only or to named test cases, then lists and downloads every attachment into a per-test-case subdirectory under --result-path.

Arguments

None.

Options

  • --execution-id <uuid> (required) — execution whose attachments to pull.
  • --project-key <key> — owning project. Either this or --test-set-key is required.
  • --test-set-key <key> — test set key (for example, DEMO:42); the project key is derived from the prefix.
  • --test-case-name <name> — filter by test case name (case-insensitive substring). Can be repeated to accept any of several names.
  • --only-failed — download attachments only for test case logs with result Failed.
  • --result-path <path> — output directory. Defaults to the current working directory. The directory is created if missing.

Examples

# download everything
uip tm attachment download \
  --execution-id a1b2c3d4-0000-0000-0000-000000000001 \
  --project-key DEMO \
  --result-path ./attachments

# only failed tests
uip tm attachment download \
  --execution-id a1b2c3d4-0000-0000-0000-000000000001 \
  --project-key DEMO \
  --only-failed \
  --test-case-name login \
  --test-case-name checkout \
  --result-path ./attachments
# download everything
uip tm attachment download \
  --execution-id a1b2c3d4-0000-0000-0000-000000000001 \
  --project-key DEMO \
  --result-path ./attachments

# only failed tests
uip tm attachment download \
  --execution-id a1b2c3d4-0000-0000-0000-000000000001 \
  --project-key DEMO \
  --only-failed \
  --test-case-name login \
  --test-case-name checkout \
  --result-path ./attachments

Data shape — normal run

{
  "Code": "AttachmentDownload",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "OutputPath": "./attachments",
    "Downloaded": 3,
    "MatchedTestCases": 2
  }
}
{
  "Code": "AttachmentDownload",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "OutputPath": "./attachments",
    "Downloaded": 3,
    "MatchedTestCases": 2
  }
}

Data shape — no matching test case logs

{
  "Code": "AttachmentDownload",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "Message": "No matching test case logs found.",
    "Downloaded": 0
  }
}
{
  "Code": "AttachmentDownload",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "Message": "No matching test case logs found.",
    "Downloaded": 0
  }
}

Data shape — some attachments failed

{
  "Code": "AttachmentDownload",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "OutputPath": "./attachments",
    "Downloaded": 2,
    "MatchedTestCases": 3,
    "Skipped": ["Login flow: HTTP 404: Not Found"]
  }
}
{
  "Code": "AttachmentDownload",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "OutputPath": "./attachments",
    "Downloaded": 2,
    "MatchedTestCases": 3,
    "Skipped": ["Login flow: HTTP 404: Not Found"]
  }
}

uip tm attachment upload

Upload a file as an attachment to a test case log or other Test Manager object.

Arguments

None.

Options

  • --object-id <uuid> (required) — UUID of the object to attach the file to (for example, a test case log ID).
  • --object-type <type> (required) — type of the object. Run uip tm attachment upload --help to see accepted values.
  • --file <path> (required) — local path to the file to upload.
  • --project-key <key> — owning project. Optional context for the upload.
  • --test-set-key <key> — test set key. Optional context for the upload.
  • --source <source> — source identifier for the attachment. Optional.
  • --attachment-type <type> — classification of the attachment (for example, screenshot, log). Optional.

Example

uip tm attachment upload \
  --object-id c3d4e5f6-0000-0000-0000-000000000001 \
  --object-type TestCaseLog \
  --file ./screenshot.png \
  --project-key DEMO \
  --attachment-type screenshot
uip tm attachment upload \
  --object-id c3d4e5f6-0000-0000-0000-000000000001 \
  --object-type TestCaseLog \
  --file ./screenshot.png \
  --project-key DEMO \
  --attachment-type screenshot

Data shape

{
  "Code": "AttachmentUpload",
  "Data": {
    "AttachmentId": "d4e5f6a7-0000-0000-0000-000000000001",
    "ObjectId": "c3d4e5f6-0000-0000-0000-000000000001",
    "ObjectType": "TestCaseLog",
    "FileName": "screenshot.png",
    "Result": "Uploaded"
  }
}
{
  "Code": "AttachmentUpload",
  "Data": {
    "AttachmentId": "d4e5f6a7-0000-0000-0000-000000000001",
    "ObjectId": "c3d4e5f6-0000-0000-0000-000000000001",
    "ObjectType": "TestCaseLog",
    "FileName": "screenshot.png",
    "Result": "Uploaded"
  }
}
  • testsets run — produces the ExecutionId used by download.
  • wait — block until the execution is terminal before pulling attachments.
  • result — JUnit XML of the same execution.
  • report — human-readable summary.

See also

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated