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.
Asked
Active
Viewed 1,520 times
1 Answers
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.
-
I know about phantomjs, i'm using it. But I need to use another browsers, like a chrome, firefox... – Alexey1993 Oct 10 '16 at 13:22