Can't tap on UIBarButtonItem

2 posts, 0 answers
  1. Arsen
    Arsen avatar
    1 posts
    Member since:
    Jun 2014

    Posted 10 Sep 2014 Link to this post


    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 ?
  2. Martin
    Martin avatar
    823 posts

    Posted 11 Sep 2014 Link to this post

    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.

    Test your Android and iOS apps against any device or browser with Telerik Mobile Testing. Part of the Telerik Platform.
Back to Top