java - FirefoxDriver takes screenshots of different size -


i made java application compares screenshots taken our staging environment against production ones. app fails due different screenshot sizes.

how can define screenshot size? using following code generate screenshot.

    final webdriver driver = new firefoxdriver();      try {         driver.manage().window().setsize(new dimension(1024, 768));         driver.get(link);         file outputfile = ((takesscreenshot) driver).getscreenshotas(outputtype.file);     .... 

as @würgspaß mentioned in comments, can outputtype.byte. here example:

byte[] bytes = driver.getscreenshotas(outputtype.bytes); bufferedimage full = imageio.read(new bytearrayinputstream(bytes)); full.getsubimage(0, 0, 1200, 800); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -