---
title: "isClosed() | Grafana k6 documentation"
description: "Browser module: page.isClosed() method"
---

# isClosed()

> Caution
> 
> This method has **known issues**. For details, refer to [#878](https://github.com/grafana/xk6-browser/issues/878).

Checks if the page has been closed.

### Returns

Expand table

| Type            | Description                                                                    |
|-----------------|--------------------------------------------------------------------------------|
| `Promise<bool>` | A Promise that fullfils with `true` if the page has been closed, else `false`. |

### Example

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
import { browser } from 'k6/browser';

export const options = {
  scenarios: {
    browser: {
      executor: 'shared-iterations',
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  await page.goto('https://test.k6.io/browser.php');
  await page.close();

  console.log(await page.isClosed());
}
```
