Skip to content

Commit d14bc8f

Browse files
committed
[master] - changes in taking screenshots
1 parent a54fdbc commit d14bc8f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/util/driver/DriverHelper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,15 @@ public static void wait(int seconds) throws InterruptedException {
106106
sleep(1000 * seconds);
107107
}
108108

109-
public static void takeScreenshot(WebDriver driver) throws Exception {
109+
public static String takeScreenshot(WebDriver driver) throws Exception {
110110
String fullFileName = System.getProperty("user.dir")
111111
+ "/target/reports/screenshots/screenshot_"
112112
+ System.currentTimeMillis() + ".png";
113113

114114
File screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
115115
FileUtils.copyFile(screenshot, new File(fullFileName));
116+
117+
return fullFileName;
116118
}
117119

118120
public static void hideKeyboard(AppiumDriver driver) {

0 commit comments

Comments
 (0)