Question

I have to run UIAutomation for touch and hold.. I am using tapWithoptions(offset,duration)..but the problem is i want to vary the cordinates on which it will tap..but thats not happening..its always taking center cordinate for some weird reason.

The same command works properly if i remove the duration parameter..but i want duration in it..following is the line i am using for it:-

target.frontMostApp().mainWindow().scrollViews()[0].scrollViews()[0].tapWithOptions({tapOffset:{x:xPos, y:yPos},duration:1.2});

Any help in this regard shall be highly appreciated

Was it helpful?

Solution

I had almost same issue. You ca try target.frontMostApp().mainWindow().scrollViews()[0].scrollViews()[0].tapWithOptions({x: 27.0, y: 949.0}, {duration:3});

If you see the documentation, tapOffset is not the exact x and y positions. It is just relatives values between 0 and 1. You have to calculate these relative values according to x, y positions.

OTHER TIPS

Tapping scrollviews is not working very well with UI Automation. The best solution is to recalculate the position into window position and tap mainWindow.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top