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

# tap()

Sends a tap event to a hittable point the system computes for the element.

## Declaration

```swift
func tap()
```

## Discussion

Discussion If the element exists within a scrollable view but is offscreen, the framework attempts to scroll the element onscreen before performing the tap.

## See Also

### Tapping and pressing

- [doubleTap()](xcuiautomation/xcuielement/doubletap().md)
- [press(forDuration:)](xcuiautomation/xcuielement/press(forduration:).md)
- [press(forDuration:thenDragTo:)](xcuiautomation/xcuielement/press(forduration:thendragto:).md)
- [press(forDuration:thenDragTo:withVelocity:thenHoldForDuration:)](xcuiautomation/xcuielement/press(forduration:thendragto:withvelocity:thenholdforduration:).md)
