Modifier and Type | Field and Description |
---|---|
ScreenshotAnimations |
animations
When set to
"disabled" , stops CSS animations, CSS transitions and Web Animations. |
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.
|
List<Locator> |
mask
Specify locators that should be masked when the screenshot is taken.
|
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.
|
Double |
timeout
Maximum time in milliseconds, defaults to 30 seconds, pass
0 to disable timeout. |
ScreenshotType |
type
Specify screenshot type, defaults to
png . |
Constructor and Description |
---|
ScreenshotOptions() |
Modifier and Type | Method and Description |
---|---|
Page.ScreenshotOptions |
setAnimations(ScreenshotAnimations animations)
When set to
"disabled" , stops CSS animations, CSS transitions and Web Animations. |
Page.ScreenshotOptions |
setClip(Clip clip)
An object which specifies clipping of the resulting image.
|
Page.ScreenshotOptions |
setClip(double x,
double y,
double width,
double height)
An object which specifies clipping of the resulting image.
|
Page.ScreenshotOptions |
setFullPage(boolean fullPage)
When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport.
|
Page.ScreenshotOptions |
setMask(List<Locator> mask)
Specify locators that should be masked when the screenshot is taken.
|
Page.ScreenshotOptions |
setOmitBackground(boolean omitBackground)
Hides default white background and allows capturing screenshots with transparency.
|
Page.ScreenshotOptions |
setPath(Path path)
The file path to save the image to.
|
Page.ScreenshotOptions |
setQuality(int quality)
The quality of the image, between 0-100.
|
Page.ScreenshotOptions |
setTimeout(double timeout)
Maximum time in milliseconds, defaults to 30 seconds, pass
0 to disable timeout. |
Page.ScreenshotOptions |
setType(ScreenshotType type)
Specify screenshot type, defaults to
png . |
public ScreenshotAnimations animations
"disabled"
, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment
depending on their duration:
transitionend
event.public Clip clip
public Boolean fullPage
false
.public List<Locator> mask
#FF00FF
that completely covers its bounding box.public Boolean omitBackground
jpeg
images.
Defaults to false
.public Path path
path
is a relative
path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to
the disk.public Integer quality
png
images.public Double timeout
0
to disable timeout. The default value can be changed by
using the BrowserContext.setDefaultTimeout()
or Page.setDefaultTimeout()
methods.public ScreenshotType type
png
.public Page.ScreenshotOptions setAnimations(ScreenshotAnimations animations)
"disabled"
, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment
depending on their duration:
transitionend
event.public Page.ScreenshotOptions setClip(double x, double y, double width, double height)
public Page.ScreenshotOptions setClip(Clip clip)
public Page.ScreenshotOptions setFullPage(boolean fullPage)
false
.public Page.ScreenshotOptions setMask(List<Locator> mask)
#FF00FF
that completely covers its bounding box.public Page.ScreenshotOptions setOmitBackground(boolean omitBackground)
jpeg
images.
Defaults to false
.public Page.ScreenshotOptions setPath(Path path)
path
is a relative
path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to
the disk.public Page.ScreenshotOptions setQuality(int quality)
png
images.public Page.ScreenshotOptions setTimeout(double timeout)
0
to disable timeout. The default value can be changed by
using the BrowserContext.setDefaultTimeout()
or Page.setDefaultTimeout()
methods.public Page.ScreenshotOptions setType(ScreenshotType type)
png
.Copyright © 2022. All rights reserved.