Package FlaNium.WinAPI.actions
Class ScreenshotActions
- java.lang.Object
-
- FlaNium.WinAPI.actions.ScreenshotActions
-
public class ScreenshotActions extends Object
-
-
Constructor Summary
Constructors Constructor Description ScreenshotActions(DesktopElement desktopElement)ScreenshotActions(FlaNiumDriver flaNiumDriver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilegetJpegScreenshotFile()Taking a screenshot of the current item.FilegetJpegScreenshotFileNotForeground()Taking a screenshot of the not foreground current item.FilegetPngScreenshotFile()Taking a screenshot of the current item.FilegetPngScreenshotFileNotForeground()Taking a screenshot of the not foreground current item.<X> XgetScreenshot(org.openqa.selenium.OutputType<X> outputType, ImageFormat imageFormat, boolean foreground)Taking a screenshot of the current item or the entire screen (if current item is driver).FilegetScreenshotFile(ImageFormat imageFormat)Taking a screenshot of the current item.FilegetScreenshotFileNotForeground(ImageFormat imageFormat)Taking a screenshot of the not foreground current item.voidsaveJpegScreenshotFile(String file)Taking a screenshot of the current item and save to file.voidsaveJpegScreenshotFileNotForeground(String file)Taking a screenshot of the not foreground current item and save to file.voidsavePngScreenshotFile(String file)Taking a screenshot of the current item and save to file.voidsavePngScreenshotFileNotForeground(String file)Taking a screenshot of the not foreground current item and save to file.
-
-
-
Constructor Detail
-
ScreenshotActions
public ScreenshotActions(FlaNiumDriver flaNiumDriver)
-
ScreenshotActions
public ScreenshotActions(DesktopElement desktopElement)
-
-
Method Detail
-
getScreenshot
public <X> X getScreenshot(org.openqa.selenium.OutputType<X> outputType, ImageFormat imageFormat, boolean foreground) throws org.openqa.selenium.WebDriverExceptionTaking a screenshot of the current item or the entire screen (if current item is driver).- Parameters:
outputType- Return type BASE64, BYTES or FILE.imageFormat- Image format: BMP, EMF, WMF, GIF, JPEG, PNG, TIFF, EXIF, ICON.foreground- If the parameter is set to false, it allows you to take a screenshot of an object that is not in the foreground (not for driver as current item).- Returns:
- Screenshot of the current item or the entire screen.
- Throws:
org.openqa.selenium.WebDriverException
-
getScreenshotFile
public File getScreenshotFile(ImageFormat imageFormat)
Taking a screenshot of the current item.- Parameters:
imageFormat- Image format: BMP, EMF, WMF, GIF, JPEG, PNG, TIFF, EXIF, ICON.- Returns:
- Screenshot file of the current item.
-
getScreenshotFileNotForeground
public File getScreenshotFileNotForeground(ImageFormat imageFormat)
Taking a screenshot of the not foreground current item. (not for driver as current item)- Parameters:
imageFormat- Image format: BMP, EMF, WMF, GIF, JPEG, PNG, TIFF, EXIF, ICON.- Returns:
- Screenshot file of the current item.
-
getPngScreenshotFile
public File getPngScreenshotFile()
Taking a screenshot of the current item. Image format: PNG.- Returns:
- Screenshot file of the current item.
-
getJpegScreenshotFile
public File getJpegScreenshotFile()
Taking a screenshot of the current item. Image format: JPEG.- Returns:
- Screenshot file of the current item.
-
getPngScreenshotFileNotForeground
public File getPngScreenshotFileNotForeground()
Taking a screenshot of the not foreground current item. Image format: PNG. (not for driver as current item)- Returns:
- Screenshot file of the current item.
-
getJpegScreenshotFileNotForeground
public File getJpegScreenshotFileNotForeground()
Taking a screenshot of the not foreground current item. Image format: JPEG. (not for driver as current item)- Returns:
- Screenshot file of the current item.
-
savePngScreenshotFile
public void savePngScreenshotFile(String file) throws IOException
Taking a screenshot of the current item and save to file. Image format: PNG.- Parameters:
file- File path.- Throws:
IOException
-
saveJpegScreenshotFile
public void saveJpegScreenshotFile(String file) throws IOException
Taking a screenshot of the current item and save to file. Image format: JPEG.- Parameters:
file- File path.- Throws:
IOException
-
savePngScreenshotFileNotForeground
public void savePngScreenshotFileNotForeground(String file) throws IOException
Taking a screenshot of the not foreground current item and save to file. Image format: PNG. (not for driver as current item)- Parameters:
file- File path.- Throws:
IOException
-
saveJpegScreenshotFileNotForeground
public void saveJpegScreenshotFileNotForeground(String file) throws IOException
Taking a screenshot of the not foreground current item and save to file. Image format: JPEG. (not for driver as current item)- Parameters:
file- File path.- Throws:
IOException
-
-