We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7b42ef commit cc9abcbCopy full SHA for cc9abcb
src/main/java/com/assertthat/selenium_shutterbug/utils/web/Browser.java
@@ -69,7 +69,13 @@ public BufferedImage takeScreenshot() {
69
return ImageIO.read(srcFile);
70
} catch (IOException e) {
71
throw new UnableTakeSnapshotException(e);
72
- }
+ } finally {
73
+ // add this to clean up leaving this file in the temporary directory forever...
74
+ if (srcFile.exists()) {
75
+ srcFile.delete();
76
+ }
77
78
+
79
}
80
81
public BufferedImage takeScreenshotEntirePage() {
0 commit comments