> For the complete documentation index, see [llms.txt](https://docs.avoautomation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avoautomation.com/avo-assure/actions/web/browser/close-all-sub-windows.md).

# Close all Sub Windows

This is a **pre-built Action** located under the **@Browser Element,** instructs Avo Assure to **close one or more sub-browser windows** (pop-ups or child tabs) during debugging or execution. The behavior depends on the value provided in the **Input Value** field, and the status is stored in a dynamic variable.

{% hint style="warning" %}
**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)`

<table><thead><tr><th>Argument</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td><p>&#x3C;all></p><p><em>(optional)</em></p></td><td>Closes <strong>all</strong> sub-browser windows except the currently active window.</td><td></td></tr><tr><td>&#x3C;window number 1; window number 2…> <em>(optional)</em></td><td>Closes the specified sub-browser windows. Multiple windows can be separated using a semicolon (e.g., 2;3;4).</td><td></td></tr></tbody></table>

**Output Value:**

<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>The dynamic variable holds the status as <strong>True</strong> or <strong>False</strong>.</td><td></td></tr></tbody></table>

**Example**

**Closes specific sub-windows, and stores the result in the dynamic variable.**

The **Close All Sub Windows** action accepts an optional value in the Input Value column **(e.g., windows 2 and 3),** to determine which sub-windows to close. The action closes either the specified window numbers or all child windows, depending on the input. The output status is stored in the **{CloseSubWinStatus}** variable with the following meanings:

* **True** - The specified sub-windows were closed successfully.
* **False** - One or more sub-windows failed to close, or an error occurred.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FcpmuZafqshM9cWm7MUk8%2Fimage.png?alt=media&amp;token=afcc2221-4589-40ca-a596-7ad34d0be697" alt=""><figcaption></figcaption></figure>


---

# 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 dynamically by asking a question.

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

```
GET https://docs.avoautomation.com/avo-assure/actions/web/browser/close-all-sub-windows.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
