Skip to content
masterclass Buddy

Cypress · Method

cy.invoke

invoke() calls a function on the previous Cypress subject and yields its return value. It supports arguments, nested function paths, and array indexes, but repeated retries can call the function more than once.

Last updated

Since
3.7.0

Syntax

.invoke(functionName)
.invoke(options, functionName)
.invoke(functionName, args...)
.invoke(options, functionName, args...)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • .as()
  • .its()
  • .then()
  • cy.window()
  • cy.wrap()

Source: cy.invoke() | Cypress API Documentation. Checked 2026-11-03.