Skip to content

Conversation

@k7z45
Copy link
Contributor

@k7z45 k7z45 commented Nov 26, 2020

Proposed a new endpoint /screenshot/full to capture full page screenshot in [1]

Copied and modified tests from webdriver/tests/take_screenshot and added one more test for a large page.
In iframe.py test_source_origin, deleted the last comparison between reference_screenshot and screenshot because
they are not the same for full page screenshot(reason unknown to me). The behavior is verified using Chrome DevTools to take full page screenshot directly. Images are the same if taking regular screenshot but different taking full page screenshot. @whimboo Any ideas?

[1] w3c/webdriver#1536

This commit is to add tests using GET screenshot/full for WebDriver
proposed at [1]. The tests are copied from take_screenshot/ and
modified to use the full page screenshot endpoint. In iframe.py
test_source_origin test, the cross origin test full page screenshot
does not generate the same png as the same origin one. This behavior
has been verified by taking the full page screenshot in browser
DevTools directly using Capture full size screenshot[2].

Added a function to get full page dimensions using
document.scrollingElement.scroll{Width,Height}.

[1] w3c/webdriver#1536
[2] https://www.deconetwork.com/blog/how-to-take-full-webpage-screenshots-instantly/#:~:text=Click%20Command%2BShift%2BP%20on,Select%20Capture%20full%20size%20screenshot.
Add a large div element so that the page does not fit in viewport
and test full page screenshot capture the entire page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants