Skip to main content

Cypress Get Command

Cypress get() method find elements based on locators on the page. This method will get one or more DOM elements by selector or alias. The querying behavior of this command is similar to how $(...) works in jQuery.


cy.get(selector, options);
cy.get(alias, options);


  • Selector is used to filter matching DOM element
  • An alias as defined using the .as() command and referenced with the @ character and the name of the alias.
  • Options: You can use 4 options within get: log, timeout, withinSubject and includeShadowDOM


cy.get('div.logo-container a.logo');

Here in get command we have specified locators or selectors. Next we will discuss how get is different from find, how to use aliases with get command and how to use get in the .within().

Submitted by tgoswami on May 30, 2021

Tarun has 11+ years of experience in Quality Assurance in different domains like Banking, E-commerce, Health and Education.


At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.