Views blocked by other views

206 views
Skip to first unread message

Adam Tews

unread,
Dec 10, 2015, 7:43:33 PM12/10/15
to KIF iOS Automated Testing Framework
Hi there,

I'm trying to automate a particular screen in an app.  There is a large image with a title below it; both can be tapped on by the user to load another view.  This USED to work when KIF tapped on it.  A recent change (and the developers remained silent when I asked them about it) caused KIF to throw the error that the view is not tappable because it is blocked by other views.  

I printed the view hierarchy, but I'm not entirely sure what it is I'm seeing.  

UIAccessibilityElementMockView, label: Fluffy Bunnies, traits: image
UIAccessibilityElementMockView, label: Fluffy Bunnies, traits: static text
UIAccessibilityElementMockView, label: Going on Now!, traits: static text
| UITableViewCellContentView
| | UIView
| | | UIImageView, label: Fluffy Bunnies (not highlighted)
| | | UILabel, label: Fluffy Bunnies
| | | UILabel, label: Going on Now!
| | | UIImageView (not highlighted)


I'm trying to tapViewWithAccessibilityLabel:@"Fluffy Bunnies".  I don't know enough about iOS development in general to understand what I'm looking at with this view hierarchy.  Can someone help me troubleshoot?

Thanks!

Michael Lupo

unread,
Dec 10, 2015, 8:26:57 PM12/10/15
to kif-fr...@googlegroups.com
You have many items with the same accessibility label, Fluffy Bunnies.
Wascal wabbits! 
Perhaps adding traits to your tap call. 
What happens if you use this...
[tester  tapViewWithAccessibilityLabel:@"Fluffy Bunnies" traits: UIAccessibilityTraitButton]
I'm going off memory so take my syntax with a grain of salt.

Sent from my iPad
--
You received this message because you are subscribed to the Google Groups "KIF iOS Automated Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kif-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Tews

unread,
Dec 14, 2015, 1:30:07 PM12/14/15
to KIF iOS Automated Testing Framework
Your syntax is right.  :)  Adding the button trait doesn't help, though.  I tried using other traits, e.g. link, image, static text, but got "view is not enabled for interaction".

Craig Fisher

unread,
Dec 21, 2015, 3:23:21 PM12/21/15
to KIF iOS Automated Testing Framework
Given the error message you received, find the view in question a make sure that the userInteractionEnabled is set to true.  If that doesn't solve it, you can also (on the same element) set the isAccessibilityElement and make sure that it's also set to true.
Reply all
Reply to author
Forward
0 new messages