Skip to main content

Method Signature

await opensteer.hover(options: HoverOptions): Promise<ActionResult>
Moves the mouse cursor over an element without clicking. Useful for triggering hover effects, tooltips, and dropdown menus.

Parameters

options
HoverOptions
required
Configuration for the hover action

Returns

ActionResult
Promise<ActionResult>

Examples

Basic Hover

// Hover to reveal dropdown menu
await opensteer.hover({
  description: 'Settings menu'
})

Hover with Selector

// Hover using CSS selector
await opensteer.hover({
  selector: '.profile-avatar',
  description: 'User avatar'
})

Show Tooltip

// Hover to display tooltip
await opensteer.hover({
  description: 'Help icon'
})

// Extract tooltip text
const tooltip = await opensteer.getElementText({
  description: 'Tooltip'
})
// Hover over parent menu
await opensteer.hover({
  description: 'File menu'
})

// Hover over submenu
await opensteer.hover({
  description: 'Export submenu'
})

// Click final option
await opensteer.click({
  description: 'Export as PDF'
})

Hover at Specific Position

// Hover at a specific point within the element
await opensteer.hover({
  description: 'Image preview',
  position: { x: 100, y: 50 }
})

Force Hover

// Force hover even if element is not immediately actionable
await opensteer.hover({
  description: 'Hidden menu trigger',
  force: true
})

Hover with Element Counter

// Use element counter from snapshot
await opensteer.hover({
  element: 23,
  description: 'Navigation item'
})
  • click - Click on elements
  • scroll - Scroll elements into view before hovering
  • input - Fill text into inputs