Package com.codeborne.selenide
Class Screenshots
java.lang.Object
com.codeborne.selenide.Screenshots
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<Screenshot>
Get the last screenshot taken in currentcontext
threadstatic @Nullable File
Get the last screenshot takenGet the last screenshot taken in current threadstatic String
static void
startContext
(String className, String methodName) static Screenshot
takeScreenShot
(String className, String methodName) static File
takeScreenShot
(org.openqa.selenium.WebElement element) Take screenshot of the WebElement/SelenideElementstatic @Nullable File
takeScreenShot
(org.openqa.selenium.WebElement iframe, SelenideElement element) Take screenshot of WebElement/SelenideElement in iframe for partially visible WebElement/Selenide horizontal scroll bar will be presentstatic @Nullable File
Take screenshot and return as a filestatic BufferedImage
takeScreenShotAsImage
(org.openqa.selenium.WebElement element) Take screenshot of the WebElement/SelenideElementstatic @Nullable BufferedImage
takeScreenShotAsImage
(org.openqa.selenium.WebElement iframe, SelenideElement element) Take screenshot of WebElement/SelenideElement in iframe for partially visible WebElement/Selenide horizontal scroll bar will be present
-
Field Details
-
screenshots
-
-
Constructor Details
-
Screenshots
public Screenshots()
-
-
Method Details
-
saveScreenshotAndPageSource
-
takeScreenShot
-
takeScreenShotAsFile
Take screenshot and return as a file- Returns:
- a temporary file, not guaranteed to be stored after tests complete.
-
takeScreenShot
Take screenshot of the WebElement/SelenideElement- Returns:
- a temporary file, not guaranteed to be stored after tests complete.
-
takeScreenShot
public static @Nullable File takeScreenShot(org.openqa.selenium.WebElement iframe, SelenideElement element) Take screenshot of WebElement/SelenideElement in iframe for partially visible WebElement/Selenide horizontal scroll bar will be present- Returns:
- a temporary file, not guaranteed to be stored after tests complete.
-
takeScreenShotAsImage
public static @Nullable BufferedImage takeScreenShotAsImage(org.openqa.selenium.WebElement iframe, SelenideElement element) Take screenshot of WebElement/SelenideElement in iframe for partially visible WebElement/Selenide horizontal scroll bar will be present- Returns:
- buffered image
-
takeScreenShotAsImage
Take screenshot of the WebElement/SelenideElement- Returns:
- buffered image
-
startContext
-
finishContext
-
getLastScreenshot
Get the last screenshot taken- Returns:
- null if there were no any screenshots taken
-
getLastThreadScreenshot
Get the last screenshot taken in current thread- Returns:
Optional
with screenshot of current thread, or an empty Optional if there were no any screenshots taken.
-
getLastContextScreenshot
Get the last screenshot taken in currentcontext
thread- Returns:
Optional
with screenshot of currentcontext
thread, or an empty Optional if there were no any screenshots taken.
-