Package com.microsoft.playwright
Class ElementHandle.ScreenshotOptions
- java.lang.Object
-
- com.microsoft.playwright.ElementHandle.ScreenshotOptions
-
- Enclosing interface:
- ElementHandle
public static class ElementHandle.ScreenshotOptions extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ElementHandle.ScreenshotOptions.Type
-
Field Summary
Fields Modifier and Type Field Description Boolean
omitBackground
Hides default white background and allows capturing screenshots with transparency.Path
path
The file path to save the image to.Integer
quality
The quality of the image, between 0-100.Integer
timeout
Maximum time in milliseconds, defaults to 30 seconds, pass0
to disable timeout.ElementHandle.ScreenshotOptions.Type
type
Specify screenshot type, defaults topng
.
-
Constructor Summary
Constructors Constructor Description ScreenshotOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ElementHandle.ScreenshotOptions
withOmitBackground(Boolean omitBackground)
ElementHandle.ScreenshotOptions
withPath(Path path)
ElementHandle.ScreenshotOptions
withQuality(Integer quality)
ElementHandle.ScreenshotOptions
withTimeout(Integer timeout)
ElementHandle.ScreenshotOptions
withType(ElementHandle.ScreenshotOptions.Type type)
-
-
-
Field Detail
-
path
public Path path
The file path to save the image to. The screenshot type will be inferred from file extension. Ifpath
is a relative path, then it is resolved relative to current working directory. If no path is provided, the image won't be saved to the disk.
-
type
public ElementHandle.ScreenshotOptions.Type type
Specify screenshot type, defaults topng
.
-
quality
public Integer quality
The quality of the image, between 0-100. Not applicable topng
images.
-
omitBackground
public Boolean omitBackground
Hides default white background and allows capturing screenshots with transparency. Not applicable tojpeg
images. Defaults tofalse
.
-
timeout
public Integer timeout
Maximum time in milliseconds, defaults to 30 seconds, pass0
to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
-
-
Method Detail
-
withPath
public ElementHandle.ScreenshotOptions withPath(Path path)
-
withType
public ElementHandle.ScreenshotOptions withType(ElementHandle.ScreenshotOptions.Type type)
-
withQuality
public ElementHandle.ScreenshotOptions withQuality(Integer quality)
-
withOmitBackground
public ElementHandle.ScreenshotOptions withOmitBackground(Boolean omitBackground)
-
withTimeout
public ElementHandle.ScreenshotOptions withTimeout(Integer timeout)
-
-