hp iOS Coder
hp iOS Coder

Reputation: 3234

Way to avoid chain of gestures to test iPhone App code often

Suppose an application runs fine. But now app is in a phase of adding functionality to it. Assume programmer added functionality to one button which is visible after applying many gesture on iPhone.

(for example, tap one of the tabs then, tap one of the tableview cells visible thereafter, then few more taps & say on Navigation bar one button is visible to which programmer added functionality ).

So while testing functionality of that button, programmer has to tap the iPhone many times to goto that specific button. If that added functionality is critical & needs to be tested many times then it would be tedious process of just reaching that button which may lead to some frustration.

So is there any tool available that will help user in skipping this chain of tappings on iPhone.

Or is there any other way to test such an app.

Upvotes: 3

Views: 256

Answers (2)

Sam
Sam

Reputation: 2579

Don't neglect the preprocessor constants as well. Something like:

#if TARGET_IPHONE_SIMULATOR
    // Some code to automatically skip the view controllers leading to this
#else
    // Production code
#endif

Otherwise I would investigate the UIAutomation classes for automating input to an iOS application. Furthermore, you should be Unit Testing the code behind your buttons. Writing a unit tests that pushes a button will always work. It's really rather pointless to unit test the framework code.

Upvotes: 2

pmf
pmf

Reputation: 597

You can use Instruments with UIAutomation, which lets you script UI actions, log messages and take screenshots. The test scripts are written using Javascript (search for UIAElement to find the API reference).

But the best resource to get you started is the WWDC 2010 session "Automating User Interface Testing with Instruments".

You should also read the Accessibility Programming Guide since UI Automation leverages on that.

Upvotes: 5

Related Questions