- 概述
- UiPath CLI
- Azure DevOps 扩展程序
- Jenkins 插件

CI/CD 集成用户指南
测试包或运行测试集
Prerequisites:
- 创建包或测试集。
- 运行 CLI
exe(适用于 Windows)或dll(适用于 Linux)文件。 - 添加所需的 Orchestrator API 访问应用程序作用域。
要测试包,请执行以下步骤:
- 使用
uipcli test运行test任务。 您可以查看可用子任务的列表。 - 指定所需的参数并运行
run子任务。请参阅下面的参数列表。
| 参数 | 描述 |
|---|---|
-P , or --project-path | 要测试的测试包文件的路径。 |
--projectKey | The project key displayed in Test Manager > Dashboard tab > Projects > All projects. The project key is the prefix for all object keys. Required when using Test Manager. |
--testsetkey | The Test Set key displayed in Test Manager > Test Sets tab > Key column. Ensure that the Test Set includes the most recent version of the Test Cases. If the Test Set is not in the default folder, make sure to include the relevant folder name before it. For instance, use AccountingTeam\TestSet. |
-s , or --testset | 要执行的测试集的显示名称。 确保测试集包含最新版本的测试用例。如果测试集不在默认文件夹中,请确保在其前面添加相关文件夹名称。 例如,使用“AccountingTeam\TestSet”。 |
--out | 结果文件的类型 <junit|uipath>。 |
-r , or --result_path | 要存储结果的文件的目标路径。 |
-e 或--environment (传统文件夹为必要项) | 要部署包的环境。您必须将它与project path配对。 |
-w , or --timeout | 等待测试集执行的时间(以秒为单位)。默认值为7200 秒(72 秒) 。 |
-i 或--input_path (如果入口点工作流具有要通过命令行传递的输入参数,则为必填项) | json 输入文件的完整路径。 |
--attachRobotLogs | 附加每个已执行测试用例的机器人日志和 JUnit 测试报告。 |
|
| 项目进行版本控制时所在的存储库 URL。 |
|
| 从中提交构建项目的存储库。 |
|
| 从中构建项目的存储库分支。 |
|
| VCS 系统存储库类型。 |
|
| Automation Hub 概念 URL。 |
--releaseNotes | 添加发行说明。 |
--disableBuiltInNugetFeeds | 禁用内置 NuGet 订阅源。 |
|
| 失败的测试用例的重试次数。 |
-u 或--username (如果通过用户名和密码使用基本身份验证,则为必需) | 用于向 Orchestrator 进行身份验证的用户名。 您必须将其与相应的密码配对。 |
-p 或--password (如果通过用户名和密码使用基本身份验证,则为必需) | 用于对 Orchestrator 进行身份验证的密码。您必须将其与相应的用户名配对。 |
-t 或--token (如果使用 基于令牌的身份验证 , 则为必填项 ) | 用于对 Orchestrator 进行身份验证的OAuth2 刷新令牌。您必须将其与帐户名称和客户端 ID配对。 |
-a 或--accountName (如果使用 基于令牌的身份验证 , 则为必填项 ) | Orchestrator CloudRPA 帐户名称。您必须将其与OAuth2 刷新令牌和客户端 ID配对。 |
-A , --accountForApp | Orchestrator CloudRPA 帐户名称(组织名称)。您必须将其与外部应用程序的应用程序 ID、应用程序密码和应用程序作用域配对。 |
-I 或--applicationId (如果使用 外部应用程序身份验证 , 则为必填项 ) | 外部应用程序 ID。您必须将其与“应用程序帐户”、“应用程序密码”和“应用程序作用域”配对。 |
-S 或--applicationSecret (如果使用 外部应用程序身份验证 , 则为必填项 ) | 外部应用程序密码。您必须将其与“应用程序帐户”、“应用程序 ID”和“应用程序作用域”配对。 |
--applicationScope (如果使用 外部应用程序身份验证 , 则为必填项 ) | The list of application scopes, separated by single spaces. You must pair it with the Application Account , Application ID , and Application Secret for external application. When using Test Manager, include: |
-o , or --organizationUnit | 要在其中执行测试集的 Orchestrator 文件夹。 |
-l , or --language | Orchestrator 用户界面中使用的语言。 |
-y , or --disableTelemetry | 禁用遥测数据。 |
|
| 显示事件的跟踪。 |
--identityURL (对于PaaS或MSI部署为必需) | 身份服务器的 URL。 |
|
| 显示此命令的参数和示例。 |
|
| 显示版本信息。 |
Orchestrator URL (pos. 0) (必填) | Orchestrator 实例的 URL。 |
|
| 包或测试集所在的租户。 |
用法:
test run <orchestrator_url> <orchestrator_tenant> [-i <input_path>] [-P <package>] [-s <testset>] [-u <orchestrator_user> -p <orchestrator_pass>] [-t <auth_token> -a <account_name>] [-A <account_for_app> -I <application_id> -S <application_secret> --applicationScope] [-e <environment>] [-o <folder_organization_unit>] [-l <language>]
test run <orchestrator_url> <orchestrator_tenant> [-i <input_path>] [-P <package>] [-s <testset>] [-u <orchestrator_user> -p <orchestrator_pass>] [-t <auth_token> -a <account_name>] [-A <account_for_app> -I <application_id> -S <application_secret> --applicationScope] [-e <environment>] [-o <folder_organization_unit>] [-l <language>]
示例:
Orchestrator testing:
test run "https://orch-23-10-paas.cloudapp.azure.com/" "TenantName" -u "orchestratorUsername" -p "********" -o "FolderName" --traceLevel Information -P "C:\userprofile\AutomationProjectWithTestCases\project.json"test run "https://orch-23-10-paas.cloudapp.azure.com/" "TenantName" -I "76000552-3e4f-4590-9317-cdb420001f1d" -S "********" --applicationScope "OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring" --identityUrl "https://orch-23-10-paas.cloudapp.azure.com/identity" -o "FolderName" --traceLevel Information -P "C:\userprofile\AutomationProjectWithTestCases\project.json"test run "https://automation-suite.base.url.com/" "TenantName" -A "organizationName" -I "3f6239b9-e0e8-465e-a429-d9ffd1d9e57a" -S "********" --applicationScope "OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring" -o "FolderName" --traceLevel Information -P "C:\userprofile\AutomationProjectWithTestCases\project.json"test run "https://cloud.uipath.com/" "TenantName" -A "organizationName" -I "becc663c-8f1e-409a-a75f-c00330d80bc8" -S "********" --applicationScope "OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring" -o "FolderName" --traceLevel Information -P "C:\userprofile\AutomationProjectWithTestCases\project.jsontest run "https://orch-23-10-paas.cloudapp.azure.com/" "TenantName" -u "orchestratorUsername" -p "********" -o "FolderName" --traceLevel Information -P "C:\userprofile\AutomationProjectWithTestCases\project.json" --out junittest run "https://orch-23-10-paas.cloudapp.azure.com/" "TenantName" -u "orchestratorUsername" -p "********" -o "FolderName" --traceLevel Information -P "C:\userprofile\AutomationProjectWithTestCases\project.json" --out uipath
Test Manager testing:
test run "https://cloud.uipath.com/" "TenantName" --projectKey "MyTestProject" --testsetkey "MyTestSet" -A "organizationName" -I "becc663c-8f1e-409a-a75f-c00330d80bc8" -S "********" --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" -o "FolderName" --out "junit" --result_path "C:\TestResults"test run "https://cloud.uipath.com/" "TenantName" --projectKey "MyTestProject" -P "C:\userprofile\AutomationProjectWithTestCases\project.json" -e "TestEnvironment" -A "organizationName" -I "becc663c-8f1e-409a-a75f-c00330d80bc8" -S "********" --applicationScope "OR.Folders OR.Execution TM.Projects TM.TestSets TM.TestExecutions OR.Assets OR.BackgroundTasks OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read" -o "FolderName" --out "uipath" --result_path "C:\TestResults"
For more details on using Test Manager with UiPath CLI, see Testing a package or running a test set in Test Manager.