Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getScreenshot only prints the fold of the page #275

Open
fede-green opened this issue Nov 27, 2017 · 2 comments
Open

getScreenshot only prints the fold of the page #275

fede-green opened this issue Nov 27, 2017 · 2 comments

Comments

@fede-green
Copy link

fede-green commented Nov 27, 2017

hello,

with this code i manage to get a screenshot, but can't find a way of getting the whole page. Only the fold of the page is saved:

    $driver = $this->getSession()->getDriver();
    $this->getSession()->getDriver()->maximizeWindow();
    file_put_contents($filename . $arg1 . "_full" . $ext, $driver->getScreenshot());

whatever browser i'm using (tried firefox and chrome), i get only partial screenshots. Am i missing anything?

thanks

@aik099
Copy link
Member

aik099 commented Nov 27, 2017

What the fold is? Do you mean the area of that page, that is visible to user (viewport) and not all page content including one not visible to user, but which user can scroll to?

I'm not sure if taking screenshot on all page area (including outside of viewport) is supported by Selenium.

@oleg-andreyev
Copy link
Contributor

Some browser driver take screenshots of the whole document (e.g. Geckodriver with Firefox) and others only of the current viewport (e.g. Chromedriver with Chrome).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants