Hover
Type: page-hover · Package: Browser v1.0.9
Moves the mouse pointer over an element, without clicking. It’s for triggering behaviors that only appear when the cursor hovers: drop-down menus, tooltips, buttons that reveal themselves, navigation submenus.
How it works
Section titled “How it works”It locates the element by its selector, waits until it’s visible, stable and not covered by another element (scrolling it into view if needed) and places the mouse at its center, firing its hover/mouseover events. It’s typically followed by a Click on the option that appeared. The pointer stays there until the next mouse action.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
selector | selector | — | The element to hover over. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
page | ZoanPageSession | — | The page session. Omit it inside a body; outside, pass the session variable (e.g. page = page). |
timeout | number | 30000 | Maximum time in ms to wait. Empty, 0 or negative: the project settings value or, if none, 30000. |
Output
Section titled “Output”This activity does not return a value.
Example
Section titled “Example”Open a menu that appears on hover and click an option:
Page Hover selector = (#menuUsuario)Page Wait For selector = (.opcion-cerrar-sesion) state = visiblePage Click selector = (.opcion-cerrar-sesion)Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Hover failed: Timeout 30000ms exceeded. … | matches: 0 (…) | It didn’t find the element. Check the selector or wait first with Wait For. |
Hover failed: … | matches: 1 (the element exists but the action did not complete: …) | The element is hidden or covered by another. Close whatever covers it. |
'page' must be a ZoanPageSession. | page is empty outside a body. |