4

I've tried looking for a while, but is there a way to record user actions on iphones/iphone simulators for testing with Instruments? Mainly I want to be able to target an app and record whatever user input I enter, then have that be able to play back/get data for that. Thanks!

nschum
  • 15,322
  • 5
  • 58
  • 56
lipd
  • 47
  • 2
  • 6

3 Answers3

2

There are 2 options in Instruments:

1) Use User Interface recorder instrument, that will record mouse move and clicks of the user and allows to replay these. (Unfortunately it seems that Phone Simulator do not expose your app accessibility elements to UI recorder).

2) Simulate interactions with Automation instrument in javascript using UIA classes - useful for writing interface tests for the app or simulating user interactions. You can read intro about using Automation in this blogpost by Alex Vollmer.

jki
  • 4,617
  • 1
  • 34
  • 29
  • Thanks! I knew about simulating the interactions with javascript, but I just needed to know if the recording of mouse commands and such was possible when using the simulator. – lipd May 12 '11 at 11:44
  • Unfortunately I found out that Simulator does not provide capture for mouse events in UI recorder and do not expose your app accessibility elements to it. So you must stick to simulating interactions via script and Automation. – jki May 12 '11 at 17:12
  • 1
    I noticed something strange with the UI recorder in that it wouldn't let me enter text into an alert prompt I had (I would type/click the text buttons, but even though I hit enter, the recorded events wouldn't work). I could though use it to just test clicks (I just had a tableView that I would delete items from using the UI Recorder). – lipd May 12 '11 at 17:32
0

FoneMonkey is a promising third party solution, I had that working on a recent project and whilst it wasn't perfect, it does let you record user actions, play them back and so forth. Plus it seems to be open source so you can extend it yourself if required.

There is also the UIAutomation framework in iOS but I have no direct experience with it.

Roger
  • 15,793
  • 4
  • 51
  • 73
  • Yea mainly I was looking for help with the UIAutomation framework since that is what I would have to use. Thanks though! – lipd May 11 '11 at 15:47
0

As Roger said, you're going to have to use the UIAutomation framework. Apple's documentation should get you where you need to go. Also, take a look at this.

You have to write the automation in JavaScript. Annoying, I know, but with enough examples in front of you you should be able to pick it up in under an hour.

Peter Kazazes
  • 3,600
  • 7
  • 31
  • 60
  • I knew about the javascript and mostly how to write that, but I just wanted to know whether I could record mouse actions and such with instruments. Thanks for the links though, as I am also learning the automation with javascript. – lipd May 12 '11 at 11:46