Skip to main content

Sandbox

Properties

Methods

doubleClick()

Double left click on the current mouse position.
Returns
Promise<void>

getCursorPosition()

Get the current cursor position.
Returns
Promise<null | CursorPosition> A object with the x and y coordinates
Throws
Error if cursor position cannot be determined

getScreenSize()

Get the current screen size.
Returns
Promise<null | ScreenSize> An ScreenSize object
Throws
Error if screen size cannot be determined

leftClick()

Left click on the current mouse position.
Returns
Promise<void>

middleClick()

Middle click on the current mouse position.
Returns
Promise<void>

moveMouse()

Move the mouse to the given coordinates.
Parameters
Returns
Promise<void>

open()

Open a file or a URL in the default application.
Parameters
Returns
Promise<void>

press()

Press a key.
Parameters
Returns
Promise<void>

rightClick()

Right click on the current mouse position.
Returns
Promise<void>

screenshot()

Call Signature
Take a screenshot and save it to the given name.
Returns
Promise<Uint8Array<ArrayBufferLike>> A Uint8Array bytes representation of the screenshot.
Call Signature
Take a screenshot and save it to the given name.
Parameters
Returns
Promise<Uint8Array<ArrayBufferLike>> A Uint8Array bytes representation of the screenshot.
Call Signature
Take a screenshot and save it to the given name.
Parameters
Returns
Promise<Blob> A Blob representation of the screenshot.
Call Signature
Take a screenshot and save it to the given name.
Parameters
Returns
Promise<ReadableStream<Uint8Array<ArrayBufferLike>>> A ReadableStream of bytes representation of the screenshot.

scroll()

Scroll the mouse wheel by the given amount.
Parameters
Returns
Promise<void>

waitAndVerify()

Wait for a command to return a specific result.
Parameters
Returns
Promise<boolean> true if the command returned the result within the timeout, otherwise false.

write()

Write the given text at the current cursor position.
Parameters
Returns
Promise<void>

create()

Call Signature
Create a new sandbox from the default desktop sandbox template.
Type Parameters
Parameters
Returns
Promise<InstanceType<S>> sandbox instance for the new sandbox.
Example
Constructs
Sandbox
Create a new sandbox from the specified sandbox template.
Type Parameters
Parameters
Returns
Promise<InstanceType<S>> sandbox instance for the new sandbox.
Example
Constructs
Sandbox
Display identifier.

dpi?

Dots per inch (DPI) setting for the display.

enableAuth?

Whether to enable authentication for noVNC connections.

port?

Port number for the noVNC proxy server.

resolution?

The screen resolution in pixels, specified as [width, height].

vncPort?

Port number for the VNC server.