Swipe gesture in UIAutomation
Wednesday, March 23rd, 2011It took me a while to figure this out, but the key is that in your gesture coordinates, the values cannot result in a perfect translation left to right (and presumable up and down, but I didn’t test a vertical gesture.)
I use a horizontal swipe gesture on the navigationBar to bring up an alert that contains diagnostic information.
// Boiler plate code.
var target = UIATarget.localTarget();
var application = target.frontMostApp();
var mainWindow = application.mainWindow();
// Swipe gesture to bring up console.
var navigationBar = mainWindow.navigationBar();
navigationBar.dragInsideWithOptions({startOffset:{x:0.0, y:0.0}, endOffset:{x:0.8, y:0.10}, duration:0.1});
Reference: wiki