Forum Discussion

gkotkin's avatar
11 years ago
Solved

iOS: can't find navigation bar buttons by accessibilityLabel


In my iOS app I'm setting a unique AccessibilityLabel to the navigation bar button (which is UIBarButtonItem).



TestComplete fails to see this attribute: in the UI object tree it finds my button (though displaying it as _UIToolbarNavigationButton), but it's AccessibilityLabel field is empty. Thus i can't find the button in my test using this id.



For the sake of investigating I've tried setting Label and Tag fields for the button but still no luck: Tag is 0 and Label is empty.



Is this a bug or "feature"  of TestComplete?



 



P.S.



Accessing the navigation buttons via indexes is too much pain, I'd rather not do it.



 


  • Hi!

     

    Have you tried a special support for the UINavigationBar control?

     

    iOS NavigationBar Support

     

    This offers some properties and methods such as TouchItem or wItemText where you can use either index or caption of the button to interact with it.

     

    As for accessibilityLabel property - its looks like a bug and you should definetely report it.

     

    Best regards,

    UnveN

2 Replies

  • nginoza's avatar
    nginoza
    Frequent Contributor

    Hello

     

    I am having the same issue. Did you file a support ticket?

     

    If not let me know and if you have not, I will file one.

     

    • UnveN's avatar
      UnveN
      Icon for Staff rankStaff

      Hi!

       

      Have you tried a special support for the UINavigationBar control?

       

      iOS NavigationBar Support

       

      This offers some properties and methods such as TouchItem or wItemText where you can use either index or caption of the button to interact with it.

       

      As for accessibilityLabel property - its looks like a bug and you should definetely report it.

       

      Best regards,

      UnveN