---
title: "pages() | Grafana k6 documentation"
description: "Returns a list of pages inside this BrowserContext."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# pages()

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

Returns all open [Page](/docs/k6/latest/javascript-api/k6-browser/page/)s in the `BrowserContext`.

### Returns

Expand table

| Type          | Description                                                                  |
|---------------|------------------------------------------------------------------------------|
| `Array<Page>` | An array of [page](/docs/k6/latest/javascript-api/k6-browser/page/) objects. |

### 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 context = await browser.newContext();
  await context.newPage();
  const pages = context.pages();
  console.log(pages.length); // 1
  await context.close();
}
```
