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

# rightClick()

Sends a Control-click event to a hittable point the system computes for the element.

## Declaration

```swift
func rightClick()
```

## Discussion

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

## See Also

### Clicking

- [click()](xcuiautomation/xcuielement/click().md)
- [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)
