MinkSelenium2Driver
MinkSelenium2Driver copied to clipboard
getScreenshot only prints the fold of the page
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
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.
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).