> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/demisto-sdk-development-guide/demisto-sdk-guide/demisto-sdk-commands/generate-test-playbook.md).

# generate-test-playbook

Generate Cortex XSOAR or Cortex XSIAM test playbooks from integration or script YAML files.

This command generates a test playbook from integration/script YAML arguments.

<details>

<summary>Arguments</summary>

| Argument            | Description                                                                                                                                                                                                                                                                                     |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-i, --input`       | Specifies the integration/script YAML path. Must be a valid YAML file.                                                                                                                                                                                                                          |
| `-o, --output`      | Specifies the output directory or path. If not specified, and the input is located at `.../Packs/<pack_name>/Integrations`, the output is saved under `.../Packs/<pack_nam>/TestPlaybooks`. If no folder in the input hierarchy is named `Packs`, the output is saved in the current directory. |
| `-n, --name`        | Specifies the test playbook name. The output file name is `playbook-<name>_Test.yml`.                                                                                                                                                                                                           |
| `--no-outputs`      | Skips generating verification conditions for each output `contextPath`. Use when you want to determine which outputs to verify.                                                                                                                                                                 |
| `-ab, --all-brands` | Generates a test-playbook which calls commands using integrations of all available brands. When not used, the generated playbook calls commands using instances of the provided integration brand.                                                                                              |
| `-c, --commands`    | A comma-separated list of command names to generate playbook tasks for and ignores the rest of the commands. For example, `xdr-get-incidents,xdr-update-incident`.                                                                                                                              |
| `-e, --examples`    | <p>For integrations: The path to the file containing command examples. Each command should be in a separate line.</p><p>For scripts: The script example surrounded by quotes. For example: <code>-e '!ConvertFile entry\_id=\<entry\_id>'</code>.</p>                                           |
| `-u, --upload`      | Whether to upload the test playbook after the generation.                                                                                                                                                                                                                                       |

</details>

<details>

<summary>Examples</summary>

* `demisto-sdk generate-test-playbook -i Integrations/PaloAltoNetworks_XDR/PaloAltoNetworks_XDR.yml -n TestXDRPlaybook -o TestPlaybooks`

  Creates a test playbook in `TestPlaybook` folder, with filename `playbook-TestXDRPlaybook_Test.yml`.
* `demisto-sdk generate-test-playbook -i Packs/ExamplePack/Integrations/ExampleIntegration/integration.yml -n Example`

  Creates a test playbook in `Packs/ExamplePack/TestPlaybooks`, with filename `playbook-Example_Test.yml`
* `demisto-sdk generate-test-playbook -i Integrations/PaloAltoNetworks_XDR/PaloAltoNetworks_XDR.yml -n TestXDRPlaybook -o TestPlaybooks -e Integrations/PaloAltoNetworks_XDR/command_examples.txt -c xdr-get-incidents,xdr-update-incident -u`

  Creates a test playbook in `TestPlaybook` folder, with filename `playbook-TestXDRPlaybook_Test.yml` and generates tasks for only the `xdr-get-incidents`,`xdr-update-incident` commands written in the `command_examples` file, and also uploads the test playbook to Cortex XSOAR/XSIAM.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/demisto-sdk-development-guide/demisto-sdk-guide/demisto-sdk-commands/generate-test-playbook.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
