I am testing an iOS app in the simulator from the keyboard and would like for the keyboard return key to make a button on the screen be pressed. Is there a way to do this? I can move between UITextField’s with the Tab key and capture the Return key through the textFieldShouldReturn method, but I have a submit button on the page also and would like to cruise through it without going to the mouse by firing it from the keyboard. If there is a way to move the focus to the button so that I can use a space-bar as suggested by KevinDTimm that would be great. Although I can move the focus through the UITextFields with the tab key I am just not sure how to get the focus onto the button – tab is not working at this point.
Thanks in advance
From what I understand you effectively want to do an automated UI test. But in this case “you” are the automation. Thinking about it that way lead me to ios-automated-tests-with-uiautomation which may not solve your problem directly, but may be the path you should head down.
This blog references Apples UI Automation Reference Collection which states: