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) |
ElementHandle.ScreenshotOptions |
setPath(Path path) |
ElementHandle.ScreenshotOptions |
setQuality(int quality) |
ElementHandle.ScreenshotOptions |
setTimeout(double timeout) |
ElementHandle.ScreenshotOptions |
setType(ScreenshotType type) |
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)
public ElementHandle.ScreenshotOptions setPath(Path path)
public ElementHandle.ScreenshotOptions setQuality(int quality)
public ElementHandle.ScreenshotOptions setTimeout(double timeout)
public ElementHandle.ScreenshotOptions setType(ScreenshotType type)
Copyright © 2021. All rights reserved.