# iOS TouchAction throws KeyNotFound Exception

**URL:** <https://discuss.appium.io/t/ios-touchaction-throws-keynotfound-exception/35645>\
**Category:** Issues/Bugs\
**Created:** [February 13, 2022, 10:02am UTC](https://discuss.appium.io/t/ios-touchaction-throws-keynotfound-exception/35645 "2022-02-13T10:02:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomse](https://discuss.appium.io/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@tomse](https://discuss.appium.io/u/tomse)\
**Post date:** [February 13, 2022, 10:02am UTC](https://discuss.appium.io/t/ios-touchaction-throws-keynotfound-exception/35645/1 "2022-02-13T10:02:53Z")

</div>

I’m using TouchAction with coordinates to perform a Tap action on the screen of an iOS device.  
I did a through check but did not found any similar bug.  
On the line: Driver.PerformTouchAction(t); , I get a KeyNotFoundException and I have no idea what key can’t be found.  
Any ideas anyone?

 ![image](https://discuss.appium.io/uploads/default/original/2X/7/7b4af23aa2990437441dcc8b509ff3a81cca7356.png)

---

<div class="post-metadata">

**Author:** ![Aleksei](https://discuss.appium.io/user_avatar/discuss.appium.io/aleksei/32/6267_2.png) [@Aleksei](https://discuss.appium.io/u/Aleksei)\
**Post date:** [February 14, 2022, 9:14am UTC](https://discuss.appium.io/t/ios-touchaction-throws-keynotfound-exception/35645/2 "2022-02-14T09:14:10Z")

</div>

use something like:

```auto
PointOption pointOption = new PointOption().withCoordinates(x,y);
driver.performTouchAction(new TouchAction(driver).tap(pointOption)).release();

```

---

<div class="post-metadata">

**Author:** ![tomse](https://discuss.appium.io/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@tomse](https://discuss.appium.io/u/tomse)\
**Post date:** [February 14, 2022, 9:23am UTC](https://discuss.appium.io/t/ios-touchaction-throws-keynotfound-exception/35645/3 "2022-02-14T09:23:19Z")

</div>

Hi Aleksei, thanks for the answer.  
I tried using the code you offered but I now have another problem:

 ![image](https://discuss.appium.io/uploads/default/original/2X/f/fd151273e65f42253dfb864ff67cc936b230d940.png)

I will mention the I code in C# with Visual Studio IDE.

---

<div class="post-metadata">

**Author:** ![Aleksei](https://discuss.appium.io/user_avatar/discuss.appium.io/aleksei/32/6267_2.png) [@Aleksei](https://discuss.appium.io/u/Aleksei)\
**Post date:** [February 14, 2022, 9:36am UTC](https://discuss.appium.io/t/ios-touchaction-throws-keynotfound-exception/35645/4 "2022-02-14T09:36:09Z")

</div>

what is your java-client version?

```auto
package io.appium.java_client.touch.offset; -> 
public static PointOption point(int xOffset, int yOffset) {
        return new PointOption().withCoordinates(xOffset, yOffset);
    }

```

---

<div class="post-metadata">

**Author:** ![tomse](https://discuss.appium.io/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@tomse](https://discuss.appium.io/u/tomse)\
**Post date:** [February 15, 2022, 12:11pm UTC](https://discuss.appium.io/t/ios-touchaction-throws-keynotfound-exception/35645/5 "2022-02-15T12:11:17Z")

</div>

I’m using Appium C# client and not Java Client.  
Thus, this solution does not work for me.  
Is there any other way to solve the problem?

---

<div class="post-metadata">

**Author:** ![Aleksei](https://discuss.appium.io/user_avatar/discuss.appium.io/aleksei/32/6267_2.png) [@Aleksei](https://discuss.appium.io/u/Aleksei)\
**Post date:** [February 15, 2022, 12:21pm UTC](https://discuss.appium.io/t/ios-touchaction-throws-keynotfound-exception/35645/6 "2022-02-15T12:21:12Z")

</div>

try examples -\> [https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/MultiAction/TouchAction.cs](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/MultiAction/TouchAction.cs)
