Bird
0
0

How can you instruct Cypress to reload the page and bypass the browser cache?

easy📝 Conceptual Q2 of 15
Cypress - Navigation and URL
How can you instruct Cypress to reload the page and bypass the browser cache?
AUse <code>cy.reload({ cache: false })</code> to disable cache.
BUse <code>cy.reload(true)</code> to force reload without cache.
CUse <code>cy.reload('no-cache')</code> to reload without cache.
DUse <code>cy.reload()</code> as it always reloads without cache.
Step-by-Step Solution
Solution:
  1. Step 1: Check Cypress reload options

    The cy.reload() command accepts a boolean argument to control cache usage.
  2. Step 2: Using true argument

    Passing true forces the browser to reload the page without using the cache.
  3. Step 3: Invalid options

    Options like { cache: false } or string arguments are not valid for cy.reload().
  4. Final Answer:

    Use cy.reload(true) to force reload without cache. -> Option B
  5. Quick Check:

    True argument disables cache reload [OK]
Quick Trick: Pass true to cy.reload() to bypass cache [OK]
Common Mistakes:
  • Using object options instead of boolean
  • Passing string arguments to cy.reload()
  • Assuming default reload ignores cache

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes