| id | class-video |
|---|---|
| title | Video |
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import HTMLCard from '@site/src/components/HTMLCard';
When browser context is created with the recordVideo option, each page has a video object associated with it.
System.out.println(page.video().path());Alternatively, you can use Video.start() and Video.stop() to record video manually. This approach is mutually exclusive with the recordVideo option.
page.video().start();
// ... perform actions ...
page.video().stop(new Video.StopOptions().setPath(Paths.get("video.webm")));<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11video.delete
Deletes the video file. Will wait for the video to finish if necessary.
Usage
Video.delete();Returns
<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9video.path
Returns the file system path this video will be recorded to. The video is guaranteed to be written to the filesystem upon closing the browser context. This method throws when connected remotely.
Usage
Video.path();Returns
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11video.saveAs
Saves the video to a user-specified path. It is safe to call this method while the video is still in progress, or after the page has closed. This method waits until the page is closed and the video is fully saved.
Usage
Video.saveAs(path);Arguments
Returns
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59video.start
Starts video recording. This method is mutually exclusive with the recordVideo context option.
Usage
page.video().start();
// ... perform actions ...
page.video().stop(new Video.StopOptions().setPath(Paths.get("video.webm")));Arguments
optionsVideo.StartOptions(optional)-
setSizeSize (optional)#Optional dimensions of the recorded video. If not specified the size will be equal to page viewport scaled down to fit into 800x800. Actual picture of the page will be scaled down if necessary to fit the specified size.
-
Returns
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.59video.stop
Stops video recording started with Video.start().
Usage
Video.stop();
Video.stop(options);Arguments
Returns