Recommended Free Tools
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
If Cypress appears to show an old page title, first check whether the application has updated the live document title. Then assert the expected value with cy.title().should('eq', expected) rather than saving a one-time snapshot. Also check for a specific version issue: Cypress 15.19.0 had a regression affecting cy.title() when the app set window.name; Cypress lists it as fixed in 15.20.0.
What Cypress reads when you call cy.title()
cy.title() yields the title of the active page by reading its live document.title property. It does not report the original HTML response as an immutable source snapshot. A page can start with a <title> element and then change its title after JavaScript runs; assigning to document.title updates the current title and the title element in the DOM.
That distinction matters in a test. If the application changes the title only after a route transition, asynchronous request, or UI action, the test must evaluate the title after that state change. A browser tab that looks like it has an old title can also be displaying a different active document than the one your test expects.
Use a retrying assertion instead of taking a snapshot
For a title expected to change, write the test as an assertion on the Cypress query:
#1 Best Overall
cy.title().should('eq', 'Expected page title')
Cypress documents that “cy.title() will automatically retry until all chained assertions have passed”. In practice, Cypress reruns the query while the assertion is failing, until it passes or the command times out. This is usually the right way to handle an application that updates its title shortly after an action.
A snapshot inside .then() is different: the callback runs with the value available at that point, and Cypress does not keep rerunning the callback until the title changes. For example, this captures the current value once and then checks that captured value:
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
cy.title().then((title) => {
expect(title).to.equal('Expected page title')
})
That form can be useful when you deliberately need to inspect or transform a value, but it is a poor substitute for a retrying query assertion when the title is expected to update asynchronously. Prefer the direct .should() form for the final state.
Allow more time only when the app eventually reaches the right state
The cy.title() API accepts a timeout option, whose default is Cypress’s defaultCommandTimeout. A longer timeout can help if the application reliably sets the intended title, but does so later than the default wait allows. It cannot fix a title that is never assigned, is assigned the wrong value, or is overwritten afterward.
Rank #3
cy.title({ timeout: 10000 }).should('eq', 'Expected page title')
Use the project’s configured timeout when possible; the example above is a per-command value in milliseconds. Before increasing it, confirm the app has a real delay that justifies the extra wait. Otherwise, a longer timeout can make a broken title update take longer to diagnose.
Check Cypress 15.19.0 if the app sets window.name
Cypress’s 15.20.0 changelog identifies a regression in 15.19.0: when the application under test set window.name, Cypress commands that read from the application, including cy.title(), could target the command log instead of the application. The changelog says the regression was fixed in Cypress 15.20.0, released August 4, 2026.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
If your project uses 15.19.0 and application code sets window.name, check this branch before rewriting working app code to address what may be a Cypress defect. Upgrade to 15.20.0 or a later release that includes the fix, then rerun the title test. This is a specific combination of version and trigger; it does not explain every stale title.
Diagnose the mismatch in a deliberate order
- Verify the live document title. After the UI action that should change it, inspect
cy.document().its('title')or assert against it.cy.document()yields the active page’s document. If its title is still old, investigate application timing, state, or later overwrites rather than assuming Cypress has cached the HTML source. - Use a retrying assertion. Replace a one-time value capture with
cy.title().should('eq', expected)when the application may need time to update. - Check the Cypress version and trigger. If the version is 15.19.0, determine whether the app sets
window.name. That matches the regression described in the 15.20.0 changelog. - Confirm which page is active. Look at the test’s most recent visit, link click, redirect, or navigation. Cypress commands apply to the active page, not to a page the test has already left.
- Inspect the title assignment lifecycle. Find where the app sets the title, confirm that code runs after the relevant state change, and check whether a later render or route update assigns another value.
When a cross-origin navigation changes the active page
If the test navigates to a different domain, Cypress’s error guidance says commands interacting with that domain should run in the corresponding cy.origin() block. A title read after the navigation belongs to the newly active page; it is not a check of the page visited earlier.
Best Value
Keep the title assertion in the context of the page whose title you intend to verify. If navigation is the behavior under test, assert the destination title after entering its origin context. If the application changes its title without leaving the origin, use the ordinary retrying assertion instead.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Common symptoms and fixes
| Symptom | Likely explanation | What to do |
|---|---|---|
| The assertion sees the initial title immediately after an action. | The app has not updated document.title yet, or the test captured a single value. |
Assert with cy.title().should(...) after the action; verify that the app eventually assigns the intended title. |
| The title never matches, even with a retrying assertion. | The app may not assign the expected string, or another lifecycle step may overwrite it. | Inspect the live document title and the app’s title-setting code. Increase the timeout only if the correct update occurs later. |
The problem occurs on Cypress 15.19.0 and the app sets window.name. |
This matches the regression described in the Cypress 15.20.0 changelog. | Upgrade to 15.20.0 or a later release containing the fix, then rerun the test. |
| The title belongs to a different site than expected. | The test may have navigated to another active document or origin. | Confirm the current page and use the required cy.origin() context for commands interacting with the other domain. |
For visual evidence, capture the page separately from the title assertion
A screenshot can help a developer document what the page looked like during a failure, but it does not establish the value of document.title or replace the Cypress assertion. For a direct title check, keep the source of truth in the browser document and the test.
Or skip the browser setup
If you need a clean visual capture of a page while investigating a UI issue, ScreenshotNeo can return a screenshot with one GET request. It is a screenshot API and MCP server, not a Cypress title assertion tool.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. ScreenshotNeo removes cookie or consent banners, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Learn about ScreenshotNeo, or sign up for 1,000 free screenshots a month with no card.
Keep the diagnosis tied to the observed value
The decisive check is whether the active document’s live title reaches the expected string. If it does, use Cypress’s retrying assertion and check that the test is on the intended page. If it does not, investigate the application’s assignment and lifecycle. If the specific 15.19.0 plus window.name condition applies, update Cypress before treating the symptom as ordinary app timing.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

