Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8209993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:55:33+00:00 2026-06-07T09:55:33+00:00

We have a iPad app which includes a two-column news reader. The left view

  • 0

We have a iPad app which includes a two-column news reader. The left view contains the list of news of which some link directly to a news and some push another view controller with another list of news. This will also cause a UIButton to be set as the leftBarButtonItem of the navigation bar. If we are on first level, a simple image that cannot be tapped will be the leftBarButtonItem.

My goal is now to have a test that taps every news on the first level. If a news leads to a second level list, it should tap the UIButton in the navigation bar.

How can I check, if the leftBarButtonItem is “tappable”? Since it can be either an image or a button, just calling navigationBar().leftButton().tap() will lead to an error if it’s an image.

I’m also using the tuneup library if that’s any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:55:35+00:00Added an answer on June 7, 2026 at 9:55 am

    Almost all elements in UIAutomation could be tapped. It does not matter if it is an Image, View or a Button. You will get an error in case an object you are trying to tap is invalid.
    How to check:

    if ( navigationBar().leftButton().checkIsValid() )
    {
         navigationBar().leftButton().tap();
    }
    else
    {
         //do what you need.
    }
    

    or you can check if an object you are trying to tap is a button, for example (not the best way but it works):

    if ( navigationBar().leftButton().toString() == "[object UIAButton]" )
    {
        navigationBar().leftButton().tap();
    }
    else
    {
         //do what you need.
    }
    

    checkIsValid() is available for all UI elements. It will return true if an object exists.
    toString() will return [object UIAElementNil] if element is invalid or will return [object UIAButton] or [object UIAImage].

    Also try to use Apple documentation:
    http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Reference/UIAElementClassReference/UIAElement/UIAElement.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a basic iPhone/iPad app which has a ; a. List view &
I have an iPad split-view app. The detailview is a webview. In which method,
I have an iPad app which has a funky Path-style menu which is present
I have a iPad app which is NOT modified for the new iPad with
I have an iPhone/iPad app which play a HTTP Live Stream of a tv
I have an app which has different app identifier for iphone and ipad and
I have this iPad app using Storyboard. There are some file that are marked
I currently have one iPad app, but it now needs to become two. The
I have an iPad app in which I'm setting the shadow color of a
I have an iPad app in which I get the device's UDID by the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.