# getTitle

Get the title of the document shown in this browsing context. For a frame this is the title of the frame's own document.

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

```
const context = await browser.url('https://webdriver.io')

await context.getTitle()
```

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

getTitle.js

```
it('reads the title of a background tab', async () => {

    await browser.url('https://webdriver.io')

    const tab = await browser.newWindow('https://webdriver.io/docs/api', { type: 'tab' })



    console.log(await tab.getTitle()) // outputs the title of the API page

})
```

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

* **\<string>** **`return`:** the document title
