I am trying to automate some tests of my ipad application.
I have a scrollview which contains a custom view.
- The custom view overwrites the drawRect and has a TapRecognizer.
- The custom view is created into the code and I have set this properties
myView.userInteractionEnabled = YES;
[myView setIsAccessibilityElement:YES];
[myView setAccessibilityLabel:@"myView"];
- The custom view is added to the scrollview with
[myScrollView addSubview:myView];
Everything works smooth both on device and on simulator: tapping on the view, the tap recognizer callback is called and the custom view can draw something at the tap point.
I would automate the view test and then I need to simulate user's taps on myView.
In the uiautomation script I have something like this:
myView = circuitScrollView.elements()[0];
myView.logElement();
myView.tapWithOptions({x:56, y:576});
to simulate a user tap at position x=56 and y=576.
Nothing happens, it seems that myView doesn't receive any tap (just in case, I play a sound into the TapRecognizer but it has never been sounded).
I have tryed this too:
myView.tap();
no success.
Any idea ?
Thank you in advance.
Fab.