# browsingContexts

Get every open tab and window of the session as a [browsing context](/docs/api/browsingContext.md), in the order the browser reports them. This includes tabs the page opened itself, e.g. through `target="_blank"` or `window.open()`. Frames are not in this list, get them with [`frame()`](/docs/api/browsingContext/frame.md) on their tab.

Only available in a WebDriver BiDi session.

## Usage[​](#usage "Direct link to Usage")

```
await browser.browsingContexts()
```

## Example[​](#example "Direct link to Example")

browsingContexts.js

```
it('finds a tab the page opened', async () => {

    const page = await browser.url('https://the-internet.herokuapp.com/windows')

    await page.$('a[href="/windows/new"]').click()



    const tab = await browser.waitUntil(async () => (

        (await browser.browsingContexts()).find((context) => context.url.endsWith('/windows/new'))

    ))

    console.log(await tab.$('h3').getText()) // outputs: "New Window"

})
```

## Returns[​](#returns "Direct link to Returns")

* **\<BrowsingContext\[]>** **`return`:** the open tabs and windows
