# Nested test cases (shared test cases/steps)

## Nested Test Cases

This topic is important for testers who want to reuse test cases/test steps. A simple scenario might be that you want to reuse test steps for a login in various test cases so that those tests steps only have to be updated once in case of changes. As an example, let us create a scenario in which a browser is opened in a first step, an URL is entered as a second test step, and the browser is closed as a third test step.

&#x20;

<figure><img src="http://aquawiki.andagon.com/pictures/drex_nested_test_cases_custom.png" alt=""><figcaption></figcaption></figure>

&#x20; &#x20;

<figure><img src="http://aquawiki.andagon.com/pictures/drex_nested_test_cases_custom_2.png" alt=""><figcaption></figcaption></figure>

Save that test case and create a new one called `Open andagon Page`. This one has two more test steps.

<figure><img src="http://aquawiki.andagon.com/pictures/drex_nested_test_cases_custom_3.png" alt=""><figcaption></figcaption></figure>

In order to insert our test steps of the test case Open Browser into the actual test case Open andagon Page, click on ![](http://aquawiki.andagon.com/pictures/drex_nested_test_cases_custom_4.png) and select the test case and its place in the step sequence. &#x20;

<figure><img src="http://aquawiki.andagon.com/pictures/drex_nested_test_cases_custom_5.png" alt=""><figcaption></figcaption></figure>

Here, you can define under which condition the test case should be executed. In this case, define Chrome and the inner variables. &#x20;

<figure><img src="http://aquawiki.andagon.com/pictures/drex_nested_test_cases_custom_6.png" alt=""><figcaption></figcaption></figure>

By executing the test case, the parameters and test steps are resolved automatically. &#x20;

<figure><img src="http://aquawiki.andagon.com/pictures/drex_nested_test_cases_custom_7.png" alt=""><figcaption></figcaption></figure>

A nested test case will be shown as a [dependency](/documentation/items/general-item-capabilities/dependencies.md).

&#x20;

<figure><img src="http://aquawiki.andagon.com/pictures/drex_nested_test_cases_custom_8.png" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aqua-cloud.io/documentation/items/test-cases-management/nested-test-cases-shared-test-cases-steps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
