3

I think this is a first - I'm getting an error and the exception constant that I'm getting back returns nothing when I search for it on Google.

Basically I'm trying to run UI Automation on my iOS app from the CLI and am getting the following error message:

2013-02-22 13:12:17.820 ScriptAgent[16626:2e07] +[UIAXElement initialize]: UIAutomation never received kAXAccessibilityLoaded. Waited 20.02 seconds.

2013-02-22 13:12:17.826 ScriptAgent[16626:2e07] Unexpected error in -[UIAXElement_0xad343c initialize], /SourceCache/UIAutomation_Sim/UIAutomation-271/Framework/UIAXElement.m line 165, kAXErrorServerNotFound

2013-02-22 13:12:17.828 ScriptAgent[16626:2e07] Terminating app due to uncaught exception 'kUIAExeceptionAccessibilityError', reason: 'Unexpected error in -[UIAXElement_0xad343c initialize], /SourceCache/UIAutomation_Sim/UIAutomation-271/Framework/UIAXElement.m line 165, kAXErrorServerNotFound'

First throw call stack: (0x491012 0x1b78e7e 0x490deb 0xa8a55b 0x1b797cf 0x1b80a0d 0x1b77aeb 0x1b77e22 0x1b8a0e1 0xaa2605 0xa847 0x5d8d 0x866d 0x2925) libc++abi.dylib: terminate called throwing an exception

2013-02-22 13:12:18.264 instruments[16585:2227] Automation Instrument ran into an exception while trying to run the script. UIAScriptAgentSignaledException

2013-02-22 19:12:18 +0000 Fail: An error occurred while trying to run the script. Instruments Trace Complete (Duration : 41.326542s; Output : /Users/newmanp/Work/iOS/CMAiPad/CMA.Mobile/UIScripts/instrumentscli3.trace)

I search on kAXAccessibilityLoaded or kAXErrorServerNotFound and get no hits at all. Here's what my command line call looks like:

instruments -t ~/Work/iOS/Platforms/iPhoneOS.platform//Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate /Users/newmanp/Library/Application\ Support/iPhone\ Simulator/6.0/Applications/B60B9BD7-357D-49AA-9E6F-986929C5D151/CMA.app -e UIASCRIPT ./cmaAutomationTests.js -e UIARESULTSPATH "."

Any suggestions of what I might be doing wrong greatly appreciated.

fogwolf
  • 931
  • 7
  • 26
  • I don't see anything immediately wrong in the way you're running it. Those errors are quite strange. I've never seen those before and I run UI Automation against several apps daily. I'm wondering if something is wrong with your Xcode install. To try to isolate the problem, download my sample project at https://github.com/jonathanpenn/AutomationExample and run the `./runautomation.sh` script to see if you get the same results. If you do, then that means your install is borked. If not, then it must be something special about your project. – Jonathan Penn Feb 22 '13 at 23:13
  • Yep, basically the same thing with your project - +[UIAXElement initialize]: UIAutomation never received kAXAccessibilityLoaded. Waited 20.02 seconds. Unexpected error in -[UIAXElement_0xad343c initialize], /SourceCache/UIAutomation_Sim/UIAutomation-271/Framework/UIAXElement.m line 165, kAXErrorServerNotFound – fogwolf Feb 25 '13 at 18:15
  • So how do I re-install Instruments? – fogwolf Feb 25 '13 at 18:17
  • This started happening to me after installing xcode 4.6. My automation was working in 4.5.2. – satyajit Mar 06 '13 at 15:43
  • After I deleted 4.6 and got back 4.5.2 though I am seeing this message -+[UIAXElement initialize]: UIAutomation never received kAXAccessibilityLoaded. Waited 20.02 seconds. Now I am able to run the automation. – satyajit Mar 06 '13 at 16:12

3 Answers3

10

We saw this error when "Enable UI Automation" wasn't turned on in the "Developer" section of the "Settings" app. Turning on the setting resolved the error.

Bob Warwick
  • 201
  • 2
  • 7
  • I have to launch Xcode and run a dummy App on the iOS device. This seems to initialize something on the phone but I am not sure what it is. After doing this the command line works. Any idea if this can be done with the command line? – Empario Jun 24 '15 at 20:25
  • This was exactly the problem that I was experiencing – Donovan Feb 19 '16 at 16:50
0

I had something similar, try

sudo rm /tmp/instruments_sock

You can see it here https://github.com/appium/appium/issues/172

0

My UIAScriptAgentSignaledException is resolved by enabling the 'Enable UI Automation' option in iPhone/Settings/Developer/UI Automation section.

bILL
  • 1
  • 1