---
schema_version: "1"
id: b178cf8c726f6aadede27bd839d951b2fd9ba3d951572564b202efc7d12f6d2c
title: agent test resume
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfclireference/guides/agent/cli_reference_agent_test_resume.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_agent_test_resume.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9f5796e39246217ee09cf1b95705823642611fe7d5e862c941a3a617d27b8fb9
products:
  - Salesforce CLI Command Reference
  - salesforcedx
---
<!-- prettier-ignore-start -->

# agent test resume

Resume an agent test that you previously started in your org so you can view the test results.

## Description for agent test resume

This command requires a job ID, which the original "agent test run" command displays when it completes. You can also use the --use-most-recent flag to see results for the most recently run agent test.

Use the --wait flag to specify the number of minutes for this command to wait for the agent test to complete; if the test completes by the end of the wait time, the command displays the test results. If not, the CLI returns control of the terminal to you, and you must run "agent test resume" again.

By default, this command outputs test results in human-readable tables for each test case. The tables show whether the test case passed, the expected and actual values, the test score, how long the test took, and more. Use the --result-format to display the test results in JSON or Junit format. Use the --output-dir flag to write the results to a file rather than to the terminal.

## Flags

| Flag Name (Long) | Flag Name (Short) | Description |
|------------------|-------------------|-------------|
| <code>&#8209;&#8209;api&#8209;version</code> | N/A | **Type:** Value<br><br>Override the api version used for api requests made by this command |
| <code>&#8209;&#8209;flags&#8209;dir</code> | N/A | **Type:** Value<br><br>Import flag values from a directory. |
| <code>&#8209;&#8209;job&#8209;id</code> | <code>&#8209;i</code> | **Type:** Value<br><br>Job ID of the original agent test run. |
| <code>&#8209;&#8209;json</code> | N/A | **Type:** Boolean<br><br>Format output as json. |
| <code>&#8209;&#8209;output&#8209;dir</code> | <code>&#8209;d</code> | **Type:** Value<br><br>Directory to write the agent test results into.<br><br>If the agent test run completes, write the results to the specified directory. If the test is still running, the test results aren't written. |
| <code>&#8209;&#8209;result&#8209;format</code> | N/A | **Type:** Value<br>**Valid Values:** `json`, `human`, `junit`, `tap`<br>**Default value:** `human`<br><br>Format of the agent test run results. |
| <code>&#8209;&#8209;target&#8209;org</code> | <code>&#8209;o</code> | **Type:** Value<br>**Required**<br><br>Username or alias of the target org. Not required if the `target-org` configuration variable is already set. |
| <code>&#8209;&#8209;test&#8209;runner</code> | N/A | **Type:** Value<br>**Valid Values:** `agentforce-studio`, `testing-center`<br><br>Explicitly specify which test runner to use (agentforce-studio or testing-center).<br><br>By default, the command automatically detects which test runner to use based on the test definition metadata type in your org. Use this flag to explicitly specify the runner type. 'agentforce-studio' uses AiTestingDefinition metadata. 'testing-center' uses AiEvaluationDefinition metadata. |
| <code>&#8209;&#8209;use&#8209;most&#8209;recent</code> | <code>&#8209;r</code> | **Type:** Boolean<br><br>Use the job ID of the most recent agent test run. |
| <code>&#8209;&#8209;verbose</code> | N/A | **Type:** Boolean<br><br>Show generated data in the test results output.<br><br>When enabled, includes detailed generated data (such as invoked actions) in the human-readable test results output. This is useful for debugging test failures and understanding what actions were actually invoked during the test run.<br><br>The generated data is in JSON format and includes the Apex classes or Flows that were invoked, the Salesforce objects that were touched, and so on. Use the JSON structure of this information to build the test case JSONPath expression when using custom evaluations. |
| <code>&#8209;&#8209;wait</code> | <code>&#8209;w</code> | **Type:** Value<br><br>Number of minutes to wait for the command to complete and display results to the terminal window. |

## Examples for agent test resume

Resume an agent test in your default org using a job ID:

```shell
sf agent test resume --job-id 4KBfake0000003F4AQ
```

Resume the most recently-run agent test in an org with alias "my-org" org; wait 10 minutes for the tests to finish:

```shell
sf agent test resume --use-most-recent --wait 10 --target-org my-org
```

Resume the most recent agent test in your default org, and write the JSON-formatted results into a directory called "test-results":

```shell
sf agent test resume --use-most-recent --output-dir ./test-results --result-format json
```
<!-- prettier-ignore-end -->
