05 / 10

List all Querying Commands

These commands are used to select and retrieve elements or properties from the DOM:
  1. 1

    cy.get(selector): Selects elements matching the given CSS selector.​

  2. 2

    cy.contains(text): Finds elements containing the specified text.​

  3. 3

    cy.find(selector): Finds descendant elements of the current subject.​

  4. 4

    cy.children(): Gets the children of each element in the set of matched elements.​

  5. 5

    cy.parent(): Gets the parent of each element in the set of matched elements.​

  6. 6

    cy.eq(index): Selects the element at the specified index.​

  7. 7

    cy.first() / cy.last(): Selects the first or last element in a set.​

  8. 8

    cy.prev() / cy.next(): Gets the previous or next sibling element.​

  9. 9

    cy.siblings(): Gets all sibling elements.​

  10. 10

    cy.root(): Gets the root DOM element.​

  11. 11

    cy.document(): Gets the document object.​

  12. 12

    cy.window(): Gets the window object.​

  13. 13

    cy.title(): Gets the page title.​

  14. 14

    cy.url(): Gets the current URL.​

  15. 15

    cy.location(): Gets the location object.​

  16. 16

    cy.hash(): Gets the current URL hash.​

  17. 17

    cy.invoke(functionName): Invokes a function on the current subject.​

  18. 18

    cy.its(propertyName): Gets a property of the current subject.​

  19. 19

    cy.wrap(value): Wraps a value into a Cypress chainable object.