Retrieves the host associated with this Venom instance.
The host associated with this Venom.
Retrieves the host associated with this Venom instance.
The host associated with this Venom.
Simulates pressing a keyboard key.
The key to press.
// Hold the 'A' key.
await venom.keyPress(KeyCode.A)
Simulates releasing a keyboard key.
The key to release.
// Press the 'A' key before releasing it.
await venom.keyPress(KeyCode.A)
// Release the 'A' key.
await venom.keyRelease(KeyCode.A)
Simulates a mouse click action.
// Press the left mouse button.
await venom.mouseClick()
// Press the right mouse button.
await venom.mouseClick({ key: 'right' })
// Press the left mouse button at the position (100, 100).
await venom.mouseClick({ x: 100, y: 100 })
// Press the left mouse button at the position (100, 100) in relative space.
await venom.mouseClick({ x: 100, y: 100, space: 'relative' })
Moves the mouse to the specified position.
The options for the mouse move action.
// Moves the mouse to the position (100, 100).
await venom.mouseMoveTo({ x: 100, y: 100 })
// Moves the mouse to the position (100, 100) in relative space.
await venom.mouseMoveTo({ x: 100, y: 100, space: 'relative' })
Simulates a mouse press action.
// Press the left mouse button.
await venom.mousePress()
// Press the right mouse button.
// await venom.mousePress({ key: 'right' })
// Press the left mouse button at the position (100, 100).
// await venom.mousePress({ x: 100, y: 100 })
// Press the left mouse button at the position (100, 100) in relative space.
// await venom.mousePress({ x: 100, y: 100, space: 'relative' })
Simulates a mouse release action.
// Press the left mouse button before releasing the mouse.
await venom.mousePress()
// Release the left mouse button.
await venom.mouseRelease()
// Release the right mouse button.
// await venom.mouseRelease({ key: 'right' })
// Release the left mouse button at the position (100, 100).
// await venom.mouseRelease({ x: 100, y: 100 })
// Release the left mouse button at the position (100, 100) in relative space.
// await venom.mouseRelease({ x: 100, y: 100, space: 'relative' })
Simulates a mouse scroll down action.
// Scroll down the mouse wheel.
await venom.mouseScrollDown()
// Scroll down the mouse wheel by 3 ticks.
await venom.mouseScrollDown({ tick: 3 })
// Scroll down the mouse wheel by 3 ticks at the position (100, 100).
await venom.mouseScrollDown({ tick: 3, x: 100, y: 100 })
// Scroll down the mouse wheel by 3 ticks at the position (100, 100) in relative space.
await venom.mouseScrollDown({ tick: 3, x: 100, y: 100, space: 'relative' })
Simulates a mouse scroll up action.
// Scroll up the mouse, default is one tick.
await venom.mouseScrollUp()
// Scroll up the mouse wheel by 3 ticks.
await venom.mouseScrollUp({ tick: 3 })
// Scroll up the mouse wheel by 3 ticks at the position (100, 100).
await venom.mouseScrollUp({ tick: 3, x: 100, y: 100 })
// Scroll up the mouse wheel by 3 ticks at the position (100, 100) in relative space.
await venom.mouseScrollUp({ tick: 3, x: 100, y: 100, space: 'relative' })
Static createCreates a Venom instance based on the provided URL, window context, and host descriptor.
The URL from which the Venom is being created. (TODO: Remove this argument in future versions)
A Promise resolving to a Venom instance.
Represents a Venom entity that exists within a window environment.