small medium large xlarge

01 Sep 2013, 08:29
shinji (3 posts)


I am reading 3.4 Grouping Test Steps and Their Output. The check_results_list.js with try/catch block doesn’t fail as shown Figure 21 or 22 when pressing the play button under the script pain.

The result in the Editor Log is Error instead of Fail, including the "Issue: Script ended without explicting closing this test".

Am I doing wrong? My environment is Xcode 4.6.3, Instrument 4.6, and iOS Simulator 6.1.

When pressing the Record button on top left corner, the result in the Trace log becomes bit different. The log group is Error, although it includes “Fail”. The timing of log output seems different from what shown in Figure 21 or 22.

Here are the Screen shots of the log.

*Editor Log *Trace Log


01 Sep 2013, 21:03
Jonathan Penn (44 posts)

Hmm. Not sure why it’s different, but I wouldn’t worry about it. Instruments often behaves differently in different contexts. If you attach to an application instead of profiling with Xcode, it might do this, too.

Regardless, the UI Automation instrument is just letting you know that you didn’t close the log group. That doesn’t matter for the stuff covered in the book because I teach throwing exceptions to stop the script with errors. The error still shows up in the trace log even though you might see that issue.

The log grouping is useful in other cases, like if you don’t want to stop the script after an error. This might be the case when doing stress or performance testing where an “error” might not mean catastrophe. For all the tests in the book, though, an error means that the app isn’t in a useful state that the script exists anymore. Trying to just log the error and continue would be pointless.

I hope that bit of backstory helps. Again, I’m not sure why you’re seeing that message in this situation but it won’t hinder you going through the book.

02 Sep 2013, 07:26
shinji (3 posts)

Hi Jonathan,

Thank you for your response. I’m relieved to hear it doesn’t matter for the stuff covered in the book. I will keep read it.

If this Instruments behavior hinders my workflow, I will try to investigate more.

02 Sep 2013, 12:37
Jonathan Penn (44 posts)

Yes, and please let me know!