UIAutomation is it possible to get elements name using x and y cordinates
Currently i am trying to create a 'soak test' for my iPhone app. i am randomly tapp开发者_JAVA百科ing at set x and y co ordinates. Is it possible to find the element that i am tapping?
any ideas would be great
Dan
I head somebody talk about "monkey" which apparently does these kind of things for Android, maybe google related "monkey alternatives" or "Monkey Ios"
Storing your elements in a dictionary and use the coordinates as a key would be a possibility.
NSString *key = [NSString stringWithFormat:@"%f%f", tap.Xcoordinate, tap.YCoordinate];
[dictionary objectForKey: key];
You can do it this way iterate through all the subviews in the view and check the intersection point using CGRectInsect function. It returns a bool and then you can get that object.
精彩评论