Package com.microsoft.playwright
Class Page.ScreenshotOptions
- java.lang.Object
-
- com.microsoft.playwright.Page.ScreenshotOptions
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
Page.ScreenshotOptions.Clip
static class
Page.ScreenshotOptions.Type
-
Field Summary
Fields Modifier and Type Field Description Page.ScreenshotOptions.Clip
clip
An object which specifies clipping of the resulting image.Boolean
fullPage
When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport.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.Page.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 Page.ScreenshotOptions.Clip
setClip()
Page.ScreenshotOptions
withFullPage(Boolean fullPage)
Page.ScreenshotOptions
withOmitBackground(Boolean omitBackground)
Page.ScreenshotOptions
withPath(Path path)
Page.ScreenshotOptions
withQuality(Integer quality)
Page.ScreenshotOptions
withTimeout(Integer timeout)
Page.ScreenshotOptions
withType(Page.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 Page.ScreenshotOptions.Type type
Specify screenshot type, defaults topng
.
-
quality
public Integer quality
The quality of the image, between 0-100. Not applicable topng
images.
-
fullPage
public Boolean fullPage
When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults tofalse
.
-
clip
public Page.ScreenshotOptions.Clip clip
An object which specifies clipping of the resulting image. Should have the following fields:
-
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 Page.ScreenshotOptions withPath(Path path)
-
withType
public Page.ScreenshotOptions withType(Page.ScreenshotOptions.Type type)
-
withQuality
public Page.ScreenshotOptions withQuality(Integer quality)
-
withFullPage
public Page.ScreenshotOptions withFullPage(Boolean fullPage)
-
setClip
public Page.ScreenshotOptions.Clip setClip()
-
withOmitBackground
public Page.ScreenshotOptions withOmitBackground(Boolean omitBackground)
-
withTimeout
public Page.ScreenshotOptions withTimeout(Integer timeout)
-
-