ios automation ios的自动化UI测试

 

var target = UIATarget.localTarget();

var app = target.frontMostApp();
var window = app.mainWindow();
target.logElementTree();
for (var i = 0; i < 10; i++) {
	UIATarget.localTarget().tap({x:10, y:460});
	target.logElementTree();
	UIATarget.localTarget().tap({x:70, y:460});
	target.logElementTree();
	UIATarget.localTarget().tap({x:200, y:460});
	target.logElementTree();
	UIATarget.localTarget().tap({x:280, y:460});
	//打印除当前界面的控件数信息
	target.logElementTree();
}

 http://blog.manbolo.com/2012/04/08/ios-automated-tests-with-uiautomation

相关推荐