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

# click()

Sends a click event to a hittable point computed for the element.

## Declaration

```swift
func click()
```

## Discussion

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

## See Also

### Clicking

- [click(forDuration:thenDragTo:)](xcuiautomation/xcuielement/click(forduration:thendragto:).md)
- [click(forDuration:thenDragTo:withVelocity:thenHoldForDuration:)](xcuiautomation/xcuielement/click(forduration:thendragto:withvelocity:thenholdforduration:).md)
- [doubleClick()](xcuiautomation/xcuielement/doubleclick().md)
- [rightClick()](xcuiautomation/xcuielement/rightclick().md)
