UiPath Documentation
uipath-cli
latest
false
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

UiPath CLI 用户指南

uip tm 测试集

uip tm testsets管理测试集:Test Manager 中的可执行单元。测试集是一组有序的测试用例,您可以使用一个命令运行这些用例,并作为单次执行进行跟踪。每个testsets run调用都会返回一个ExecutionId ,其他uip tm动词( waitexecutionsreportresultattachment )将其用作输入。

大纲

uip tm testsets create --project-key <key> --name <name> [--description <text>]
uip tm testsets list --project-key <key> [--folder-key <uuid>] [--filter <text>]
uip tm testsets update --test-set-key <key> [--name <name>] [--description <text>]
uip tm testsets delete --test-set-key <key>
uip tm testsets list-testcases --test-set-key <key>
uip tm testsets run --test-set-key <key> [--execution-type <type>] [--input-path <file>]
uip tm testsets create --project-key <key> --name <name> [--description <text>]
uip tm testsets list --project-key <key> [--folder-key <uuid>] [--filter <text>]
uip tm testsets update --test-set-key <key> [--name <name>] [--description <text>]
uip tm testsets delete --test-set-key <key>
uip tm testsets list-testcases --test-set-key <key>
uip tm testsets run --test-set-key <key> [--execution-type <type>] [--input-path <file>]

所有动词都遵循全局选项和标准退出代码。每个动词接受-t, --tenant <name>--log-level <level> (默认为Information )。

采用--test-set-key的测试集动词从密钥的前缀中派生所属项目(例如DEMO:10 → 项目DEMO ),因此仅create--project-key需要list

创建 uip tm 测试集

在项目中创建一个空测试集。然后使用testcases add填充它。

参数

无。

选项

  • --project-key <key> (必填) — 拥有项目。
  • --name <name> (必填) — 测试集名称。
  • --description <text> — 自由格式说明。默认为空。

示例

uip tm testsets create \
  --project-key DEMO \
  --name "Smoke Suite" \
  --description "Core smoke tests"
uip tm testsets create \
  --project-key DEMO \
  --name "Smoke Suite" \
  --description "Core smoke tests"

数据形状

{
  "Code": "TestSetCreate",
  "Data": {
    "TestSetKey": "DEMO:10",
    "Name": "Smoke Suite",
    "Description": "Core smoke tests"
  }
}
{
  "Code": "TestSetCreate",
  "Data": {
    "TestSetKey": "DEMO:10",
    "Name": "Smoke Suite",
    "Description": "Core smoke tests"
  }
}

uip tm 测试集列表

列出项目中的测试集。CLI 会自动对结果进行分页。

参数

无。

选项

  • --project-key <key> (必填) — 要列出的项目。
  • --folder-key <uuid> — 限制为绑定到此 Orchestrator 文件夹的测试集。提取后在客户端应用。
  • --filter <text> — 对名称的服务器端搜索。

示例

uip tm testsets list --project-key DEMO --filter smoke
uip tm testsets list --project-key DEMO --filter smoke

数据形状

{
  "Code": "TestSetsList",
  "Data": [
    {
      "TestSetKey": "DEMO:10",
      "Name": "Smoke Suite",
      "FolderKey": "f0f0f0f0-0000-0000-0000-000000000001",
      "Id": "a1b2c3d4-0000-0000-0000-000000000010"
    }
  ]
}
{
  "Code": "TestSetsList",
  "Data": [
    {
      "TestSetKey": "DEMO:10",
      "Name": "Smoke Suite",
      "FolderKey": "f0f0f0f0-0000-0000-0000-000000000001",
      "Id": "a1b2c3d4-0000-0000-0000-000000000010"
    }
  ]
}

Id是内部 UUID — 需要,例如execution list --test-set-id

uip tm 测试集更新

重命名测试集或更改其描述。必须至少提供--name--description其中一个。

参数

无。

选项

  • --test-set-key <key> (必填) — 测试集密钥(例如DEMO:10 )。
  • --name <name> — 新名称。
  • --description <text> — 新说明。

示例

uip tm testsets update \
  --test-set-key DEMO:10 \
  --name "Smoke Suite (2026)"
uip tm testsets update \
  --test-set-key DEMO:10 \
  --name "Smoke Suite (2026)"

数据形状

{
  "Code": "TestSetUpdate",
  "Data": {
    "TestSetKey": "DEMO:10",
    "Name": "Smoke Suite (2026)",
    "Description": "Core smoke tests",
    "Result": "Updated"
  }
}
{
  "Code": "TestSetUpdate",
  "Data": {
    "TestSetKey": "DEMO:10",
    "Name": "Smoke Suite (2026)",
    "Description": "Core smoke tests",
    "Result": "Updated"
  }
}

uip tm 测试集删除

通过密钥删除测试集。

参数

无。

选项

  • --test-set-key <key> (必填) — 测试集密钥。

示例

uip tm testsets delete --test-set-key DEMO:10
uip tm testsets delete --test-set-key DEMO:10

数据形状

{
  "Code": "TestSetDelete",
  "Data": {
    "TestSetKey": "DEMO:10",
    "Id": "a1b2c3d4-0000-0000-0000-000000000010",
    "Result": "Deleted"
  }
}
{
  "Code": "TestSetDelete",
  "Data": {
    "TestSetKey": "DEMO:10",
    "Id": "a1b2c3d4-0000-0000-0000-000000000010",
    "Result": "Deleted"
  }
}

uip tm 测试集列表测试用例

列出分配给测试集的测试用例。

参数

无。

选项

  • --test-set-key <key> (必填) — 要检查的测试集。

示例

uip tm testsets list-testcases --test-set-key DEMO:10
uip tm testsets list-testcases --test-set-key DEMO:10

数据形状

{
  "Code": "TestSetTestCasesList",
  "Data": [
    {
      "TestCaseKey": "DEMO:1",
      "Name": "Login smoke",
      "Version": "1.0.0",
      "Description": "Logs in and out"
    }
  ]
}
{
  "Code": "TestSetTestCasesList",
  "Data": [
    {
      "TestCaseKey": "DEMO:1",
      "Name": "Login smoke",
      "Version": "1.0.0",
      "Description": "Logs in and out"
    }
  ]
}

运行 uip tm 测试集

运行测试集并立即返回其ExecutionId 。测试集本身必须配置有包和文件夹 - 通过在 Test Manager 的网页用户界面中创作或通过 REST API 手动完成。运行不会阻止;将其与脚本中的uip tm wait配对。

参数

无。

选项

  • --test-set-key <key> (必填) — 要运行的测试集。项目键从前缀派生。
  • --execution-type <type> — 要运行的测试用例。以下之一:
    • automated (默认) — 仅适用于自动化测试用例。
    • manual — 仅适用于手动测试用例。
    • mixed — 包括自动和手动。
    • none — 无类型筛选器。
  • --input-path <file> — 参数覆盖的 JSON 文件的路径。文件必须包含形状类似于[{"name":"Param","type":"String","value":"v"}]数组。覆盖通过name (如果存在,则使用type )与测试集的当前参数定义进行匹配,不区分大小写。如果服务器未报告任何参数定义,则按原样发送输入。

示例

# simplest
uip tm testsets run --test-set-key DEMO:10

# with parameter overrides and manual execution
uip tm testsets run \
  --test-set-key DEMO:10 \
  --execution-type mixed \
  --input-path ./params.json
# simplest
uip tm testsets run --test-set-key DEMO:10

# with parameter overrides and manual execution
uip tm testsets run \
  --test-set-key DEMO:10 \
  --execution-type mixed \
  --input-path ./params.json

数据形状

{
  "Code": "TestSetRun",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "TestSetKey": "DEMO:10",
    "Status": "Running",
    "StartTime": "2025-04-15T10:30:00Z"
  }
}
{
  "Code": "TestSetRun",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "TestSetKey": "DEMO:10",
    "Status": "Running",
    "StartTime": "2025-04-15T10:30:00Z"
  }
}
备注:

返回的Status反映启动时的状态(通常为Running );这并不意味着运行已成功。要获取运行结果,请阻止uip tm wait ,然后读取uip tm report getuip tm executions中记录了组合的启动和等待流程的退出代码行为。有关waitreport参考资料,请参阅下面的“相关”部分。

  • 测试用例— 创建并链接填充测试集的测试用例。
  • 执行— 列出并在运行测试集后重试执行。
  • wait — 阻止,直到返回的ExecutionId达到最终状态。
  • 报告结果附件— 运行后工件。

另请参阅

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新