iphoneiosui-automationios-ui-automation

Are there any existing library for Automation of UI controls in IOS


I am very new to IOS programming. I have a task to find if I can automate my UI for testing. This is what I want to do:

I have seen FoneMonkey but looks like it needs user interaction recorded manually on each device.


Solution

  • Hello Lalith i have been creating some UI Automation tests for an application and its working very well. Although it has some tricks, I think you should take a look at these links:

    http://answers.oreilly.com/topic/1646-how-to-use-uiautomation-to-create-iphone-ui-tests/

    http://alexvollmer.com/posts/2010/07/03/working-with-uiautomation/

    If you need more help, just let me know. :)

    Edit1:

    On your viewDidLoad of your viewController you can add something like this:

       - (void)viewDidLoad {
            [super viewDidLoad];
            //(Your code...)
            // I set it to start after 5 seconds...
            [self performSelector:@selector(startTest) withObject:nil afterDelay:5];
         }
    
    
       -(void)startTest{
          //took this from the link you posted
          [myButton sendActionsForControlEvents:UIControlEventTouchUpInside];
        }
    

    Edit 2:

    if([myTextField canBecomeFirstResponder]){
        [myTextField becomeFirstResponder];
    }