Bird
0
0

Which Cypress command correctly chains selectors to find a span inside a div.card?

easy📝 Conceptual Q2 of 15
Cypress - Selecting Elements
Which Cypress command correctly chains selectors to find a span inside a div.card?
Acy.find('div.card').get('span')
Bcy.find('span').get('div.card')
Ccy.get('span').find('div.card')
Dcy.get('div.card').find('span')
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct chaining order

    Use cy.get() to select the parent div.card, then .find() to locate the child span.
  2. Step 2: Verify syntax correctness

    Only cy.get() starts a chain; cy.find() alone is invalid.
  3. Final Answer:

    cy.get('div.card').find('span') -> Option D
  4. Quick Check:

    Parent get, then find child = cy.get('div.card').find('span') [OK]
Quick Trick: Start with cy.get(), then chain .find() for nested elements [OK]
Common Mistakes:
  • Using cy.find() as the first command
  • Reversing parent and child selectors
  • Using get after find in the chain

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes