Package com.codeborne.selenide
Class Screenshots
- java.lang.Object
-
- com.codeborne.selenide.Screenshots
-
public class Screenshots extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static ScreenShotLaboratoryscreenshots
-
Constructor Summary
Constructors Constructor Description Screenshots()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.io.File>finishContext()static java.io.FilegetLastScreenshot()Get the last screenshot takenstatic voidstartContext(java.lang.String className, java.lang.String methodName)static java.lang.StringtakeScreenShot(java.lang.String fileName)Take screenshot and give it filenamestatic java.lang.StringtakeScreenShot(java.lang.String className, java.lang.String methodName)static java.io.FiletakeScreenShot(org.openqa.selenium.WebElement element)Take screenshot of the WebElement/SelenideElementstatic java.io.FiletakeScreenShot(org.openqa.selenium.WebElement iframe, org.openqa.selenium.WebElement element)Take screenshot of WebElement/SelenideElement in iframe for partially visible WebElement/Selenide horizontal scroll bar will be presentstatic java.io.FiletakeScreenShotAsFile()Take screenshot and return as a filestatic java.awt.image.BufferedImagetakeScreenShotAsImage(org.openqa.selenium.WebElement element)Take screenshot of the WebElement/SelenideElementstatic java.awt.image.BufferedImagetakeScreenShotAsImage(org.openqa.selenium.WebElement iframe, org.openqa.selenium.WebElement element)Take screenshot of WebElement/SelenideElement in iframe for partially visible WebElement/Selenide horizontal scroll bar will be present
-
-
-
Field Detail
-
screenshots
public static ScreenShotLaboratory screenshots
-
-
Method Detail
-
takeScreenShot
public static java.lang.String takeScreenShot(java.lang.String className, java.lang.String methodName)
-
takeScreenShot
public static java.lang.String takeScreenShot(java.lang.String fileName)
Take screenshot and give it filename- Returns:
- absolute path of the screenshot taken
-
takeScreenShotAsFile
public static java.io.File takeScreenShotAsFile()
Take screenshot and return as a file- Returns:
- a temporary file, not guaranteed to be stored after tests complete.
-
takeScreenShot
public static java.io.File takeScreenShot(org.openqa.selenium.WebElement element)
Take screenshot of the WebElement/SelenideElement- Returns:
- a temporary file, not guaranteed to be stored after tests complete.
-
takeScreenShot
public static java.io.File takeScreenShot(org.openqa.selenium.WebElement iframe, org.openqa.selenium.WebElement 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 java.awt.image.BufferedImage takeScreenShotAsImage(org.openqa.selenium.WebElement iframe, org.openqa.selenium.WebElement element)Take screenshot of WebElement/SelenideElement in iframe for partially visible WebElement/Selenide horizontal scroll bar will be present- Returns:
- buffered image
-
takeScreenShotAsImage
public static java.awt.image.BufferedImage takeScreenShotAsImage(org.openqa.selenium.WebElement element)
Take screenshot of the WebElement/SelenideElement- Returns:
- buffered image
-
startContext
public static void startContext(java.lang.String className, java.lang.String methodName)
-
finishContext
public static java.util.List<java.io.File> finishContext()
-
getLastScreenshot
public static java.io.File getLastScreenshot()
Get the last screenshot taken- Returns:
- null if there were no any screenshots taken
-
-