A full-page screenshot captures the entire webpage from top to bottom, not just the visible part on the screen.
Click to reveal answer
beginner
How do you take a full-page screenshot in Cypress?
Use the command cy.screenshot({ capture: 'fullPage' }) to capture the entire page.
Click to reveal answer
beginner
Why are full-page screenshots useful in testing?
They help verify the entire page layout and content, catching issues that might be missed in just the visible area.
Click to reveal answer
beginner
What is the default behavior of cy.screenshot() without options?
It captures only the visible part of the webpage, not the full page.
Click to reveal answer
intermediate
Can full-page screenshots in Cypress capture content that requires scrolling?
Yes, full-page screenshots automatically scroll and stitch the entire page into one image.
Click to reveal answer
Which Cypress command option captures a full-page screenshot?
A{ scroll: true }
B{ capture: 'viewport' }
C{ full: true }
D{ capture: 'fullPage' }
✗ Incorrect
The correct option is { capture: 'fullPage' } to capture the entire page.
What part of the page does cy.screenshot() capture by default?
AOnly the visible viewport
BOnly the footer section
COnly the header section
DThe entire page
✗ Incorrect
By default, cy.screenshot() captures only the visible viewport.
Why might you prefer a full-page screenshot over a viewport screenshot?
ATo capture animations
BTo reduce file size
CTo verify the entire page layout
DTo speed up tests
✗ Incorrect
Full-page screenshots help verify the entire page layout and content.
Does Cypress automatically scroll the page when taking a full-page screenshot?
AYes, it scrolls and stitches the image
BNo, you must scroll manually
COnly if you add a plugin
DOnly on mobile devices
✗ Incorrect
Cypress automatically scrolls and stitches the full page into one screenshot.
Which of these is NOT a valid reason to use full-page screenshots in testing?
ACheck for hidden content
BCapture only visible elements
CVerify page layout
DDetect scrolling issues
✗ Incorrect
Full-page screenshots capture the entire page, not just visible elements.
Explain how to take a full-page screenshot in Cypress and why it is useful.
Think about the difference between viewport and full page capture.
You got /3 concepts.
Describe the difference between default screenshots and full-page screenshots in Cypress.
Consider what part of the page each method captures.
You got /3 concepts.
Practice
(1/5)
1. What does cy.screenshot({ capture: 'fullPage' }) do in Cypress testing?
easy
A. Clears all previous screenshots
B. Takes a screenshot of the entire webpage, including parts not visible on screen
C. Records a video of the test run
D. Takes a screenshot only of the visible part of the webpage
Solution
Step 1: Understand the capture option in cy.screenshot()
The capture option controls what part of the page is captured. Setting it to 'fullPage' means the entire page, not just the visible viewport.
Step 2: Compare with other options
By default, cy.screenshot() captures only the visible part. 'fullPage' extends this to the whole page including scrollable areas.
Final Answer:
Takes a screenshot of the entire webpage, including parts not visible on screen -> Option B
Quick Check:
Full-page screenshot = entire webpage [OK]
Hint: Remember 'fullPage' means capture everything, not just visible [OK]
Common Mistakes:
Thinking it captures only visible viewport
Confusing screenshot with video recording
Assuming it clears previous screenshots
2. Which of the following is the correct syntax to take a full-page screenshot in Cypress?
easy
A. cy.fullPageScreenshot()
B. cy.screenshot('fullPage')
C. cy.screenshot({ capture: 'fullPage' })
D. cy.screenshot.capture('fullPage')
Solution
Step 1: Recall the correct method signature
The cy.screenshot() command accepts an options object where capture: 'fullPage' is the correct way to specify full-page capture.
Step 2: Eliminate incorrect syntax
Passing 'fullPage' as a string argument directly, using non-existent commands like cy.fullPageScreenshot(), or trying to chain .capture('fullPage') are not valid Cypress syntax for full-page screenshots.
Final Answer:
cy.screenshot({ capture: 'fullPage' }) -> Option C
Quick Check:
Correct syntax uses options object with capture key [OK]
Hint: Use curly braces and capture key for full-page screenshots [OK]
Common Mistakes:
Passing 'fullPage' as a string argument directly
Using non-existent commands like cy.fullPageScreenshot()
What will happen if the page is still loading when the screenshot is taken?
medium
A. The screenshot will capture the fully loaded page anyway
B. The test will fail with an error
C. Cypress will wait automatically until the page loads before screenshot
D. The screenshot may capture an incomplete or partially loaded page
Solution
Step 1: Understand Cypress behavior on page load
Cypress does not automatically wait for all page content to load unless explicitly told. If cy.screenshot() runs immediately after cy.visit(), the page might still be loading.
Step 2: Effect on screenshot
If the page is not fully loaded, the screenshot will capture whatever is visible at that moment, possibly incomplete content.
Final Answer:
The screenshot may capture an incomplete or partially loaded page -> Option D
Quick Check:
Screenshot timing affects completeness [OK]
Hint: Always wait for page load before screenshot to avoid partial capture [OK]
Common Mistakes:
Assuming Cypress waits automatically for full load
Why does the full-page screenshot not work as expected?
medium
A. The option value 'fullpage' is case-sensitive and should be 'fullPage'
B. You must call cy.fullPageScreenshot() instead
C. The cy.screenshot() command does not support options
D. You need to add wait() before screenshot
Solution
Step 1: Check the option value spelling and case
The correct option value is 'fullPage' with capital P. 'fullpage' is invalid and ignored.
Step 2: Understand Cypress option sensitivity
Cypress options are case-sensitive. Using wrong case causes fallback to default behavior (visible viewport only).
Final Answer:
The option value 'fullpage' is case-sensitive and should be 'fullPage' -> Option A
Quick Check:
Option values are case-sensitive in Cypress [OK]
Hint: Check option spelling and case carefully [OK]
Common Mistakes:
Ignoring case sensitivity in option values
Using non-existent commands
Assuming wait fixes option errors
5. You want to capture a full-page screenshot only after a dynamic content section finishes loading. Which Cypress code snippet correctly waits for the content and then takes a full-page screenshot?
hard
A. cy.get('#dynamic-section').should('be.visible')
.then(() => cy.screenshot({ capture: 'fullPage' }))
B. cy.screenshot({ capture: 'fullPage' })
cy.get('#dynamic-section').should('be.visible')
C. cy.wait(5000)
cy.screenshot({ capture: 'fullPage' })
D. cy.get('#dynamic-section').click()
cy.screenshot({ capture: 'fullPage' })
Solution
Step 1: Wait for dynamic content visibility
Using cy.get('#dynamic-section').should('be.visible') waits until the dynamic section is visible, ensuring content is loaded.
Step 2: Take full-page screenshot after wait
Chaining .then(() => cy.screenshot({ capture: 'fullPage' })) ensures the screenshot runs only after the wait condition passes.
Final Answer:
cy.get('#dynamic-section').should('be.visible')
.then(() => cy.screenshot({ capture: 'fullPage' })) -> Option A
Quick Check:
Wait for content visible, then screenshot [OK]
Hint: Wait for element visible before screenshot using should('be.visible') [OK]
Common Mistakes:
Taking screenshot before waiting for content
Using fixed wait times instead of element checks
Clicking element unnecessarily before screenshot
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.