1

How to take full size page snapshot with Selenium on java? My page resolution more than screen resolution. When i try to set browser resolution more than the screen resolution, browser opening in full size of screen resolution. Preferably without reference to page.

Alexey1993
  • 105
  • 4

1 Answers1

3

I personally use the headless driver PhantomJS. This works fine for me, but I didn't tried with FirefoxDriver. You haven't shown what you tried so far, so I don't know which driver you use and if you already tried this.

WebDriver driver = new PhantomJSDriver();
driver.manage().window().maximize();
File screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);

Now you can save the screenshot file with simple IO. Maybe this is helpful, too.

Community
  • 1
  • 1
Maze
  • 156
  • 10