This is a migrated thread and some comments may be shown as answers.

Can't tap on UIBarButtonItem

1 Answer 49 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Arsen
Top achievements
Rank 1
Arsen asked on 10 Sep 2014, 03:13 PM
Hi,

I've tried to tap on UIBarButtonItem but was not able to do that. The item doesn't have a title and has a background UIImage. I've tried to find that element by a few parameters like tag, index or accessibility label. Is there any option to find UIBarButtonItem to tap it ?

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 11 Sep 2014, 08:27 AM
Hello Arsen,

The iOS API tap command supports Views and subclasses of the UIView class. According to Apple's documentation however, the UIBarButtonItem class does not inherit from UIView and that is why it can't be automated with the Mobile Testing framework.

However, if your UIBarButtonItem is inside another control that can be automated (UIToolBar for example), you can use the ios.tapSubviewAtIndex API command to tap on the button. The example in the documentation demonstrates this approach. You can also verify that it works as expected if you run the toolbarSpec.js suite against our iOS demo project.


Regards,
Martin
Telerik
 
Test your Android and iOS apps against any device or browser with Telerik Mobile Testing. Part of the Telerik Platform.
 
Tags
General Discussions
Asked by
Arsen
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or