# Testing a package or running a test set

> * Create a package or a test set.
* Run the CLI `exe` (for Windows) or `dll` (for Linux) file.
* Add the required Orchestrator [API access application scopes](https://docs.uipath.com/cicd-integrations/standalone/2023.10/user-guide/executing-uipath-cli-tasks).

## Prerequisites

* Create a package or a test set.
* Run the CLI `exe` (for Windows) or `dll` (for Linux) file.
* Add the required Orchestrator [API access application scopes](https://docs.uipath.com/cicd-integrations/standalone/2023.10/user-guide/executing-uipath-cli-tasks).

To test a package, take the following steps:

1. Run the `test` task, using `uipcli test`. You can see a list of the available sub-tasks.
2. Specify the required parameters and run the `run` sub-task.
   See the list of parameters below.

 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
     Parameter  
     Description  
  
 
 
  
    <code>-P</code> , or <code>--project-path</code> 
    The path to the Testing package file that you want to test. 
  
  
    <code>--projectKey</code> 
     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.  
  
  
    <code>--testsetkey</code> 
     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.  
  
  
    <code>-s</code> , or <code>--testset</code> 
     The name 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 project does not have a default folder set, make sure you assign a test folder at the Test Set level.  
  
  
    <code>--out</code> 
    The type of the result file \&lt;junit|uipath\&gt;. 
  
  
    <code>-r</code> , or <code>--result_path</code> 
    The destination path of the file where you want to store the results. 
  
  
    <code>-e</code> , or <code>--environment</code> ( Required for classic folders) 
    The environment where you want to deploy the package. You must pair it with the <code>project path</code> . 
  
  
    <code>-w</code> , or <code>--timeout</code> 
    The time (in seconds) that you want to wait for the Test Set to execute. The default value is 7200 seconds . 
  
  
    <code>-i</code> , or <code>--input_path</code> ( Required if the entry-point workflow has input parameters that you want to pass through the command line) 
    The full path to a JSON input file. See Input Parameters JSON Format for details on the file structure. 
  
  
    <code>--attachRobotLogs</code> 
    Attaches Robot Logs for each executed Test Case, and a JUnit Test Report. 
  
  
    <code>--repositoryUrl</code> 
     The repository URL where the project is versioned.  
  
  
    <code>--repositoryCommit</code> 
     The repository commit where the project was built from.  
  
  
    <code>--repositoryBranch</code> 
     The repository branch where the project was built from.  
  
  
    <code>--repositoryType</code> 
     VCS system repository type.  
  
  
    <code>--projectUrl</code> 
     Automation Hub idea URL.  
  
  
    <code>--releaseNotes</code> 
    Add release notes. 
  
  
    <code>--disableBuiltInNugetFeeds</code> 
    Disable built-in nuget feeds. 
  
  
    <code>--retryCount</code> 
     Number of retries for failed test cases.  
  
  
    <style> .css-17xdpgx\{word-break:break-word;\}.css-17xdpgx div\{padding-left:10px;\}.css-17xdpgx code\{font-size:16px;\}.css-17xdpgx img\{margin-bottom:-5px;\} </style><code>-u</code> , or <code>--username</code> ( Required if you use Basic Authentication , through a username and a password) 
     The username used for authenticating to Orchestrator. You must pair it with the corresponding password.  
  
  
    <code>-p</code> , or <code>--password</code> ( Required if you use Basic Authentication , through a username and a password) 
     The password used for authenticating to Orchestrator. You must pair it with the corresponding username.  
  
  
    <code>-t</code> , or <code>--token</code> ( Required if you use  token-based authentication  ) 
     The OAuth2 refresh token used for authenticating to Orchestrator. You must pair it with the Account Name and Client ID .  
  
  
    <code>-a</code> , or <code>--accountName</code> ( Required if you use  token-based authentication  ) 
     The Orchestrator CloudRPA account name. You must pair it with the OAuth2 refresh token and Client ID .  
  
  
    <code>-A</code> , <code>--accountForApp</code> 
     The Orchestrator CloudRPA account name(organization name). You must pair it with the Application ID , Application Secret , and Application scope for external application.  
  
  
    <code>-I</code> , or <code>--applicationId</code> ( Required if you use  external application authentication  ) 
     The external Application ID. You must pair it with the Application Account , Application Secret , and Application scope .  
  
  
    <code>-S</code> , or <code>--applicationSecret</code> ( Required if you use  external application authentication  ) 
     The external Application Secret. You must pair it with the Application Account , Application ID , and Application scope .  
  
  
    <code>--applicationScope</code> ( Required if you use  external application authentication  ) 
     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: <code>TM.Projects TM.TestSets TM.TestExecutions</code> in addition to Orchestrator scopes.  
  
  
    <code>-o</code> , or <code>--organizationUnit</code> 
     The Orchestrator folder where you want to execute the Test Sets.  
  
  
    <code>-l</code> , or <code>--language</code> 
     The language used in the Orchestrator user interface.  
  
  
    <code>-y</code> , or <code>--disableTelemetry</code> 
     Disable telemetry data.  
  
  
    <code>--traceLevel</code> 
     Display the trace of the events.  
  
  
    <code>--identityURL</code> ( Required for PaaS or MSI deployments) 
     The URL of your identity server.  
  
  
    <code>--help</code> 
     Displays the parameters and examples for this command.  
  
  
    <code>--version</code> 
     Display version information.  
  
  
    <code>Orchestrator URL (pos. 0)</code> ( Required ) 
    The URL of the Orchestrator instance. 
  
  
    <code>Orchestrator Tenant (pos. 1)</code> ( Required ) for SaaP deployments.  ( Optional ) for PaaS deployments.  
    The tenant inside which the package, or Test Set are. 
  
 

**Usage:****

```
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>]
```

## Examples

## 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.json`
* `test run "https://orch-23-10-paas.cloudapp.azure.com/" "TenantName" -u "orchestratorUsername" -p "********" -o "FolderName"
  --traceLevel Information -P "C:\userprofile\AutomationProjectWithTestCases\project.json" --out junit`
* `test 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"`

:::note
For more details on using Test Manager with UiPath CLI, see [Testing a package or running a test set in Test Manager](https://docs.uipath.com/cicd-integrations/standalone/2023.10/user-guide/testing-a-packagerunning-a-test-set-in-test-manager).
:::
