Interaction

Hover

Moves the real mouse cursor onto a web element.

Moves the real mouse cursor onto a web element.

Moves the mouse pointer onto the specified element using a real input-layer move on every engine (OS-level move on Hardware, CDP Input.dispatchMouseEvent on Puppeteer, Actions.MoveToElement on Selenium, the OttoMagic equivalent). Because the browser sees this as genuine input, CSS :hover state updates and mouseenter/mouseover/mouseleave fire naturally - this is what reveals hover-triggered menus and tooltips.

TIP

Hover is operationally identical to Move To - see the move-to entry. Browser.Hover() is a thin fluent alias that calls MoveTo() under the hood; there is no separate hover implementation. The only fallback is a JS-dispatched synthetic mouseover (JavaScriptHover), used only when no real cursor is available (e.g. headless JS-interaction mode); that path only fires JS addEventListener listeners and does NOT update CSS :hover.

Examples

GPAL Fluent: High-level fluent C# API

//Hover() and MoveTo() are interchangeable - Hover() simply forwards to MoveTo().

browser.WithSelector(selector).Hover() browser.Hover(selector)

MagicHelper: MagicHelper utility library

GPAL.MagicHelper.Hover(string css); GPAL.MagicHelper.Hover(string xpath);

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.Hover(string css).Execute(); browser.PuppeteerClient.Hover(string xpath).Execute();

Puppeteer Communicator: Low-level communicator

//The Hover REST endpoint resolves the selector to GPALElements and calls the same PuppeteerCommunicator.MoveTo(...) used by Move To - it dispatches a real CDP mouseMoved event to a randomized point within each element's bounding box.

await browser.PuppeteerCommunicator.MoveTo(List<GPALElement> elems, string sessionId, List<dynamic> responses);

REST Client: Direct REST/HTTP client

GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.Hover).WithCss(string css).Execute(); GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.Hover).WithXPath(string xpath).Execute();