I am trying to automate some tests of my ipad application.
I have a scrollview that contains a custom view.
- The custom view overwrites drawRect and has a TapRecognizer.
- A custom view is created in the code, and I set its properties
myView.userInteractionEnabled = YES; [myView setIsAccessibilityElement:YES]; [myView setAccessibilityLabel:@"myView"];
- Custom view is added to the scroll list using
[myScrollView addSubview:myView]
[myScrollView addSubview:myView]
Everything works both on the device and on the simulator: it clicks on the view, the callback recognizer is called back and the user view can draw something at the transition point.
I would automate the validation of the view, and then I needed to simulate custom branches 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 click at position x = 56 and y = 576.
Nothing happens, it looks like myView is not getting any click (just in case, I play the sound in TapRecognizer, but it never sounded).
I also tried:
myView.tap();
myView.tap();
no success.
Any idea?
Thanks in advance.
Fab.
source share