MinkSelenium2Driver icon indicating copy to clipboard operation
MinkSelenium2Driver copied to clipboard

getScreenshot only prints the fold of the page

Open fede-green opened this issue 7 years ago • 2 comments

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

fede-green avatar Nov 27 '17 09:11 fede-green

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.

aik099 avatar Nov 27 '17 11:11 aik099

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).

oleg-andreyev avatar Jan 05 '19 22:01 oleg-andreyev