# Cypress Documentation
# Source: https://raw.githubusercontent.com/cypress-io/cypress-documentation/main/docs/api/commands/title.mdx
# Path: docs/api/commands/title.mdx

---
title: 'title | Cypress Documentation'
description: Get the `document.title` property of the page that is currently active in Cypress.
sidebar_label: title
slug: /api/commands/title
---

<ProductHeading product="app" />

# title

Get the `document.title` property of the page that is currently active.

## Syntax

```javascript
cy.title()
cy.title(options)
```

### Usage

<Icon name="check-circle" color="green" /> **Correct Usage**

```javascript
cy.title() // Yields the documents title as a string
```

### Arguments

<Icon name="angle-right" /> **options _(Object)_**

Pass in an options object to change the default behavior of `cy.title()`.

| Option    | Default                                                           | Description                                                                         |
| --------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `log`     | `true`                                                            | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) |
| `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.title()` to resolve before [timing out](#Timeouts)             |

<HeaderYields />

- `cy.title()` 'yields the `document.title` property of the current page.
- `cy.title()` is a query, and it is _safe_ to chain further commands.

## Examples

### No Args

#### Assert that the document's title is "My Awesome Application"

```javascript
cy.title().should('eq', 'My Awesome Application')
```

## Rules

<HeaderRequirements />

- `cy.title()` requires being chained off of `cy`.

<HeaderAssertions />

- `cy.title()` will automatically [retry](/app/core-concepts/retry-ability)
  until all chained assertions have passed

<HeaderTimeouts />

- `cy.title()` can time out waiting for assertions you've added to pass.

## Command Log

**_Assert that the document's title includes 'New User'_**

```javascript
cy.title().should('include', 'New User')
```

The commands above will display in the Command Log as:

<DocsImage
  src="/img/api/title/test-title-of-website-or-webapp.png"
  alt="Command Log title"
/>

When clicking on `title` within the command log, the console outputs the
following:

<DocsImage
  src="/img/api/title/see-the-string-yielded-in-the-console.png"
  alt="Console Log title"
/>

## History

| Version                                    | Changes                    |
| ------------------------------------------ | -------------------------- |
| [< 0.3.3](/app/references/changelog#0-3-3) | `cy.title()` command added |

## See also

- [`cy.document()`](/api/commands/document)