I am currently working on automating tests on iPad using a home built iOS automation framework running on sdk 5.0 and xcode 4.2. One of my test requires that I hold and drag an object. I am able to touchAndHold and drag separately but can't seem to find a way to combine these actions. I have not been able to find a solution for it on http://developer.apple.com/library/ios/#documentation/DeveloperTools/Reference/UIAutomationRef/_index.html. Please help!
Asked
Active
Viewed 652 times
1 Answers
0
UIAElement has a method called. dragInsideWithOptions. The options include duration. Have you tried setting the duration to 1, then setting the rest of the drag options to meet your needs?

Roderic Campbell
- 719
- 5
- 14
-
I've tried this but it simply taps on the object that i'm trying to perform a hold and drag action on. – user1110780 Jan 25 '12 at 22:41
-
Roderic thanks for your help. The following is the line of code i'm using. `target.frontMostApp().dragInsideWithOptions({startOffset:{x:0.40,y:0.27},endOffset:{x:0.3,y:0.4},duration:1.0});` – user1110780 Jan 25 '12 at 23:16
-
@user1110780 I wonder if you tried adjusting your startOffset to x:0.4 and y:0.2 will this work? The docs say nothing about the extended decimal precision you are using but does mention support for 0.0 to 1.0. – Tommie C. Dec 08 '13 at 14:47