---
title: hover()
framework: xcuiautomation
role: symbol
role_heading: Instance Method
path: xcuiautomation/xcuielement/hover()
---

# hover()

Moves the pointer over the element.

## Declaration

```swift
func hover()
```

## Discussion

Discussion If the element exists within a scrollable view but is offscreen, XCTest attempts to scroll the element onscreen before moving the cursor over the element.
