class Playwright::ElementHandle::ScreenshotOptions
- Playwright::ElementHandle::ScreenshotOptions
- Reference
- Object
Included Modules
- JSON::Serializable
Defined in:
playwright/elementhandle.crConstructors
- .new(pull : JSON::PullParser)
- .new(path : Path | Nil = nil, type : Playwright::ElementHandle::ScreenshotOptions::Type | Nil = nil, quality : Int32 | Nil = nil, omit_background : Bool | Nil = nil, timeout : Int32 | Nil = nil)
Instance Method Summary
-
#omit_background : Bool | Nil
Hides default white background and allows capturing screenshots with transparency.
-
#omit_background=(omit_background : Bool | Nil)
Hides default white background and allows capturing screenshots with transparency.
-
#path : Path | Nil
The file path to save the image to.
-
#path=(path : Path | Nil)
The file path to save the image to.
-
#quality : Int32 | Nil
The quality of the image, between 0-100.
-
#quality=(quality : Int32 | Nil)
The quality of the image, between 0-100.
-
#timeout : Int32 | Nil
Maximum time in milliseconds, defaults to 30 seconds, pass
0
to disable timeout. -
#timeout=(timeout : Int32 | Nil)
Maximum time in milliseconds, defaults to 30 seconds, pass
0
to disable timeout. -
#type : Type | Nil
Specify screenshot type, defaults to
png
. -
#type=(type : Type | Nil)
Specify screenshot type, defaults to
png
.
Constructor Detail
Instance Method Detail
Hides default white background and allows capturing screenshots with transparency. Not applicable to jpeg
images. Defaults to false
.
Hides default white background and allows capturing screenshots with transparency. Not applicable to jpeg
images. Defaults to false
.
The file path to save the image to. The screenshot type will be inferred from file extension. If #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.
The file path to save the image to. The screenshot type will be inferred from file extension. If #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.
The quality of the image, between 0-100. Not applicable to png
images.
Maximum time in milliseconds, defaults to 30 seconds, pass 0
to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout)
or page.setDefaultTimeout(timeout)
methods.
Maximum time in milliseconds, defaults to 30 seconds, pass 0
to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout)
or page.setDefaultTimeout(timeout)
methods.