Using TouchAction and MultiTouch in C# for iOS app

I am trying to automate few tests for our iOS app using the appium dotnet driver. The test is to sign on an UIAImage on the app. Running into issues when I am trying the sign action by using the TouchAction and MultiTouch. Below is the code, can someone please help me by pointing out the mistake here …

IWebElement el = driver.FindElementByAccessibilityId(“SignaturePad”);
ITouchAction action = new TouchAction(driver);
action.Press(el, 10, 10).Wait(30).MoveTo(el, 25, 25).Release();//.Perform();

If I add the Perform, we get a null ref exception, while with the above code the test passes, but it does actually nothing.

Here is something else I tried, but didnt work either

ITouchAction a1 = new TouchAction(driver);
a1.Press(el, 223, 398);
ITouchAction a2 = new TouchAction(driver);
a2.MoveTo(el, 222, 361);
IMultiAction m = new MultiAction (driver);
m.Perform ();

Any pointers to this is appreciated! Thanks!

Small correction to the last 2 lines of Multitouch action above, it is adding actions a1 and a2, not just a1.

m.Perform ();

Why don’t you go above and edit your post so it’s easier for us to understand what’s going on. You should be able to edit your own posts.

Never mind, I got this resolved. Thanks!

1 Like

Hey how did u resolved this issue. Can i see the code

1 Like