public static class ElementHandle.ScreenshotOptions extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ElementHandle.ScreenshotOptions.Type |
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. |
ElementHandle.ScreenshotOptions.Type |
type
Specify screenshot type, defaults to
png . |
Constructor and Description |
---|
ScreenshotOptions() |
Modifier and Type | Method and Description |
---|---|
ElementHandle.ScreenshotOptions |
withOmitBackground(boolean omitBackground) |
ElementHandle.ScreenshotOptions |
withPath(Path path) |
ElementHandle.ScreenshotOptions |
withQuality(int quality) |
ElementHandle.ScreenshotOptions |
withTimeout(double timeout) |
ElementHandle.ScreenshotOptions |
withType(ElementHandle.ScreenshotOptions.Type 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 [method: BrowserContext.setDefaultTimeout
] or [method: Page.setDefaultTimeout
] methods.public ElementHandle.ScreenshotOptions.Type type
png
.public ElementHandle.ScreenshotOptions withOmitBackground(boolean omitBackground)
public ElementHandle.ScreenshotOptions withPath(Path path)
public ElementHandle.ScreenshotOptions withQuality(int quality)
public ElementHandle.ScreenshotOptions withTimeout(double timeout)
public ElementHandle.ScreenshotOptions withType(ElementHandle.ScreenshotOptions.Type type)
Copyright © 2021. All rights reserved.