Bird
0
0

Which of the following is the correct syntax to scroll to the bottom of the page using cy.scrollTo()?

easy📝 Syntax Q12 of 15
Cypress - Element Interactions
Which of the following is the correct syntax to scroll to the bottom of the page using cy.scrollTo()?
Acy.scrollTo('down')
Bcy.scrollTo('bottom')
Ccy.scrollTo('end')
Dcy.scrollTo('bottomRight')
Step-by-Step Solution
Solution:
  1. Step 1: Recall valid position names

    Valid positions include 'top', 'bottom', 'left', 'right', etc. 'bottom' scrolls to the page bottom.
  2. Step 2: Check each option

    'down' and 'end' are invalid; 'bottomRight' is a valid position in Cypress.
  3. Final Answer:

    cy.scrollTo('bottomRight') -> Option D
  4. Quick Check:

    Scroll bottomRight = 'bottomRight' [OK]
Quick Trick: Use standard position names like 'top', 'bottom', or 'bottomRight' in quotes [OK]
Common Mistakes:
  • Using invalid position names like 'down' or 'end'
  • Forgetting quotes around position strings
  • Trying to use combined positions incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes