# Close all Sub Windows

This is a pre-built Action located under the **@Browser Element**. The functionality of this Action in Avo Assure is to close one or more sub-browser windows during debugging or execution. The result is stored in a dynamic variable for further use during test execution.

{% hint style="info" %}
**Note**: The parent browser window will remain open unless specifically closed using other actions.
{% endhint %}

## **Syntax**

**Input Value**: `<all>(optional)/window number 1;window number 2…>(optional)`&#x20;

<table><thead><tr><th>Argument</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td><p>&#x3C;all> </p><p>(optional)</p></td><td>Provide <strong>all</strong> sub browser windows to close except the currently active one.</td><td></td></tr><tr><td>&#x3C;window number 1; window number 2…> (optional)</td><td>Provide the sub browser windows to close. Separate multiple window numbers using a semicolon (for example, 2;3;4)</td><td></td></tr></tbody></table>

&#x20;**Output Value**: `<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)`

<table><thead><tr><th>Argument</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>&#x3C;Dynamic Variable>(Optional);&#x3C;Dynamic Variable>(Optional)</td><td>Both dynamic variable stores the status as <strong>True</strong> or <strong>False</strong>.</td><td></td></tr></tbody></table>

### Example: Closing Specific Sub-Windows

In this example, we explain how to close specific sub-windows or all child windows using the **Close All Sub Windows** action.

* **Action**: Close all Sub Windows
* **Input Value**: 2;3
  * The input value, (**2;3**) specifies the sub-window numbers that need to be closed. If no input value is provided, all child windows opened during execution will be closed.
* **Output Value**: {SubWin}
  * The result of closes sub-window operation is stored in the **{SubWin}** dynamic variable, which returns one of the following values:
    * **True**: If the specified sub windows is closed successfully.
    * **False**: If the specified sub windows is not closed successfully.
* **Logical Explanation**: The **Close all Sub Windows** action takes the value from the **Input Value** column (**2;3**) and closes the specified sub windows. If no input is given, it closes all open child windows by default. The execution result is stored in the **{SubWin}** variable as true.

<figure><img src="/files/giKmdPJnEAjxctxyifJt" 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.avoautomation.com/avo-assure/actions/web/browser/close-all-sub-windows-1.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.
