Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

How to Get the descendent DOM elements of a specific selector

Category: Cypress

To get the descended DOM element of a specific locator, use cy.find() function as seen in the example below:

For HTML Code

The following command returns all ordered list (li) elements inside the unordered list (ul) element

cy.get(‘#parent’).find(‘li’)

Leave a Reply

Your email address will not be published. Required fields are marked *