cicd-integrations
2025.10
true
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

CI/CD 集成用户指南

上次更新日期 2025年12月10日

UiPath 测试

Typically, the UiPath Test task runs an existing test set on Orchestrator. Additionally, you can use it to pack, deploy, and run test cases by specifying the path to a UiPath test project.

任务执行完成后,测试结果将上传到 Azure DevOps 中的“测试”选项卡。您可以 JUnit 格式指定测试结果输出路径。

根据结果,构建将被标记为成功(所有测试用例都通过)或失败(至少一个测试用例失败)。

配置

使用下表配置 UiPath 测试输入。

参数描述
显示名称是必填项输入租户的名称。
选择测试执行方法Choose the test that you wish to execute: Execute test set: Specify and run an existing test set in Test Manager or Orchestrator. Execute tests in project: Specify a project, deploy the package and run the test cases.
需要 Orchestrator 连接。配置服务连接以访问 UiPath Orchestrator 服务。您只能为此步骤配置连接,也可以使用现有的全局连接。有关更多信息,请参阅“配置 UiPath Orchestrator 服务连接”。
Project key (only for Test Manager)Specify the project key in Test Manager (also known as Project Prefix). Required when executing tests in Test Manager. Leave empty for Orchestrator Testing Module.
输入参数指定 JSON 输入文件的文件路径,例如Input\jobParameters.json 。 如果要在测试集级别创建新输入参数,请指定type参数。 否则,您可以使用namevalue
测试集执行测试集方法需要)The name or key shown for the Test Set you wish to execute. Ensure that the Test Set includes the most recent version of the Test Cases. If the Test Set isn't in the default folder, make sure to include the relevant folder name before it. For instance, use AccountingTeam\TestSet.
测试项目路径在项目方法中执行测试需要)Specify the test project location that is going to be executed.
环境在项目方法中执行测试需要)如果使用传统文件夹(已弃用),则需要定义将要部署包的环境。您可以使用此字段创建或更新包。您可以使用以下示例将环境添加到此字段,以逗号分隔:testingEnvironment, productionEnvironment
Orchestrator 文件夹(必需)指定正在部署流程的文件夹。对于传统文件夹,您可以使用指定的机器人名称。对于新式文件夹,您可以使用指定的用户和计算机名称。 要输入子文件夹,请确保同时输入父文件夹的名称和子文件夹的名称。例如,AccountingTeam\TeamJohn
测试结果输出路径以 JUnit 格式(例如Output\testResults.json)指定测试结果输出路径。
超时指定请求超时前要等待的秒数。
追踪级别从下拉列表中选择用户。
附加机器人日志选择此选项可附加正在执行的机器人中的 INFO 级别日志。默认情况下,此选项处于取消选中状态。有关更多信息,请参阅“机器人日志”。

docs image

YAML 管道

您可以为 UiPath 测试预览完全解析的 YAML 文档。

Example: Execute test set from Orchestrator

- task: UiPathTest@6
  displayName: 'Run Orchestrator Test Set'
  inputs:
    testTarget: TestSet
    orchestratorConnection: 'uipath-orchestrator-connection'
    testSet: 'MobileAutomationTests'
    folderName: 'MobileAutomationTesting'
    testReportDestination: '$(Build.ArtifactStagingDirectory)\report.xml'
    timeout: 3600
    traceLevel: 'Information'
- task: UiPathTest@6
  displayName: 'Run Orchestrator Test Set'
  inputs:
    testTarget: TestSet
    orchestratorConnection: 'uipath-orchestrator-connection'
    testSet: 'MobileAutomationTests'
    folderName: 'MobileAutomationTesting'
    testReportDestination: '$(Build.ArtifactStagingDirectory)\report.xml'
    timeout: 3600
    traceLevel: 'Information'

Example: Execute test set from Test Manager

- task: UiPathTest@6
  displayName: 'Run Test Manager Test Set'
  inputs:
    testTarget: TestSet
    orchestratorConnection: 'uipath-orchestrator-connection'
    projectKey: 'PROJ'  # Test Manager project key (Project Prefix)
    testSet: 'TS-123'   # Test Manager test set key
    folderName: 'TestManagerFolder'
    testReportDestination: '$(Build.ArtifactStagingDirectory)\testmanager-results.xml'
    timeout: 3600
    attachRobotLogs: true
    traceLevel: 'Information'
- task: UiPathTest@6
  displayName: 'Run Test Manager Test Set'
  inputs:
    testTarget: TestSet
    orchestratorConnection: 'uipath-orchestrator-connection'
    projectKey: 'PROJ'  # Test Manager project key (Project Prefix)
    testSet: 'TS-123'   # Test Manager test set key
    folderName: 'TestManagerFolder'
    testReportDestination: '$(Build.ArtifactStagingDirectory)\testmanager-results.xml'
    timeout: 3600
    attachRobotLogs: true
    traceLevel: 'Information'

Example: Execute test project

- task: UiPathTest@6
  displayName: 'Run Test Project'
  inputs:
    testTarget: TestProject
    orchestratorConnection: 'uipath-orchestrator-connection'
    testProjectPath: '$(Build.SourcesDirectory)\MobileAutomationTests'
    folderName: 'MobileAutomationTesting'
    environment: 'TestingRobots'  # Required only for classic folders
    testReportDestination: '$(Build.ArtifactStagingDirectory)\test-results.xml'
    timeout: 3600
    traceLevel: 'Information'
- task: UiPathTest@6
  displayName: 'Run Test Project'
  inputs:
    testTarget: TestProject
    orchestratorConnection: 'uipath-orchestrator-connection'
    testProjectPath: '$(Build.SourcesDirectory)\MobileAutomationTests'
    folderName: 'MobileAutomationTesting'
    environment: 'TestingRobots'  # Required only for classic folders
    testReportDestination: '$(Build.ArtifactStagingDirectory)\test-results.xml'
    timeout: 3600
    traceLevel: 'Information'

Example: Test Manager with project execution

- task: UiPathTest@6
  displayName: 'Run Test Manager Project'
  inputs:
    testTarget: TestProject
    orchestratorConnection: 'uipath-orchestrator-connection'
    projectKey: 'PROJ'  # Test Manager project key
    testProjectPath: '$(Build.SourcesDirectory)\TestProject'
    folderName: 'TestManagerFolder'
    parametersFilePath: '$(Build.SourcesDirectory)\test-params.json'
    testReportDestination: '$(Build.ArtifactStagingDirectory)\tm-project-results.xml'
    attachRobotLogs: true
    timeout: 7200
    traceLevel: 'Verbose'
- task: UiPathTest@6
  displayName: 'Run Test Manager Project'
  inputs:
    testTarget: TestProject
    orchestratorConnection: 'uipath-orchestrator-connection'
    projectKey: 'PROJ'  # Test Manager project key
    testProjectPath: '$(Build.SourcesDirectory)\TestProject'
    folderName: 'TestManagerFolder'
    parametersFilePath: '$(Build.SourcesDirectory)\test-params.json'
    testReportDestination: '$(Build.ArtifactStagingDirectory)\tm-project-results.xml'
    attachRobotLogs: true
    timeout: 7200
    traceLevel: 'Verbose'

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2025 UiPath。保留所有权利。