views:

376

answers:

3

Hi All,

Anyone please let me know some links or examples for Unit testing user interface code. Is there a complete example app on that.

Thanks in Advance, Bhanu

A: 

I'm not aware of any publicly-available tools for testing UI for Cocoa applications. Depending on what you're hoping to test, you find find F-Script to be useful. Unit testing UI is generally a lot more complex than it sounds, especially since UI tends to change a lot during devlopment (and across localizations). If you're talking about directly testing whether button X triggers code Y, or if clicking X causes UI action Y to occur, you may be out of luck. However, you can certainly test whether methods invoked by UI work correctly.

Quinn Taylor
A: 

You could, if your app is accessible, use Automator for testing user interfaces... Just record a workflow inside your app...

Don't know if that is good enough.. Just a suggestion.

Jakob Dam Jensen
Thanks for your suggestion, how can we use automator for writing test cases, is there any document or some links or examples.Please help me out in finding this.Thanks in Advance,Bhanu
+4  A: 

I have one link that I bookmarked a while ago: Chris Hanson's blog on Unit testing Cocoa user interfaces: Target-Action

Haven't gotten around to using it myself, so I can't vouch for its usefulness. Hope it helps.

Elise van Looij