public static class ElementHandle.ScreenshotOptions extends Object
Modifier and Type | Field and 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.
|
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 |
---|---|
ElementHandle.ScreenshotOptions |
setOmitBackground(boolean omitBackground)
Hides default white background and allows capturing screenshots with transparency.
|
ElementHandle.ScreenshotOptions |
setPath(Path path)
The file path to save the image to.
|
ElementHandle.ScreenshotOptions |
setQuality(int quality)
The quality of the image, between 0-100.
|
ElementHandle.ScreenshotOptions |
setTimeout(double timeout)
Maximum time in milliseconds, defaults to 30 seconds, pass
0 to disable timeout. |
ElementHandle.ScreenshotOptions |
setType(ScreenshotType type)
Specify screenshot type, defaults to
png . |
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 ElementHandle.ScreenshotOptions setOmitBackground(boolean omitBackground)
jpeg
images.
Defaults to false
.public ElementHandle.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 ElementHandle.ScreenshotOptions setQuality(int quality)
png
images.public ElementHandle.ScreenshotOptions setTimeout(double timeout)
0
to disable timeout. The default value can be changed by
using the BrowserContext.setDefaultTimeout()
or Page.setDefaultTimeout()
methods.public ElementHandle.ScreenshotOptions setType(ScreenshotType type)
png
.Copyright © 2021. All rights reserved.