Selenium-shutterbug (https://github.com/assertthat/selenium-shutterbug) saves screenshots as png, is there any way to save them as jpg?

For example:

Shutterbug.shootPage(driver,ScrollStrategy.WHOLE_PAGE_CHROME).withName(screenshotName).save(path);
1

There are 1 best solutions below

0
On

As per the source code of Snapshot.java for selenium-shutterbug the variable EXTENSION is defined as:

private static final String EXTENSION = "PNG";

So using selenium-shutterbug you can't save the screenshot with extension as .JPG. It will be always saved in .PNG format.