Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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:

  • Put some code in my application that randomly (sounds bad but may be pre-defined events)sends event messages to controls on the screen.

  • Since it is just code I should be able to take the app, deploy it in any iPhone or iPad and run the program.

  • Once the app is completely automated by my code I guess it will be easy to do the analytics on the obtained performance data.

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

Any thoughts or suggestions are welcome.

  • Lalith
like image 474
Lalith Avatar asked Dec 06 '22 20:12

Lalith


1 Answers

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];
}
like image 75
Rui Peres Avatar answered Apr 30 '23 16:04

Rui Peres