Skip to content

Commit df60f9f

Browse files
zeeshanyshaikhglibas
authored andcommitted
Update Browser.java (#54)
Fixes #53. Clearing the device pixel on taking full screenshot in chrome
1 parent 770d9b9 commit df60f9f

File tree

1 file changed

+1
-0
lines changed
  • src/main/java/com/assertthat/selenium_shutterbug/utils/web

1 file changed

+1
-0
lines changed

src/main/java/com/assertthat/selenium_shutterbug/utils/web/Browser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ public BufferedImage takeScreenshotEntirePageUsingChromeCommand() {
169169
Object metrics = this.evaluate(FileUtil.getJsScript(ALL_METRICS));
170170
this.sendCommand("Emulation.setDeviceMetricsOverride", metrics);
171171
Object result = this.sendCommand("Page.captureScreenshot", ImmutableMap.of("format", "png", "fromSurface", true));
172+
this.sendCommand("Emulation.clearDeviceMetricsOverride", ImmutableMap.of());
172173
String base64EncodedPng = (String) ((Map<String, ?>) result).get("data");
173174
InputStream in = new ByteArrayInputStream(OutputType.BYTES.convertFromBase64Png(base64EncodedPng));
174175
BufferedImage bImageFromConvert;

0 commit comments

Comments
 (0)