I have just finished updating the way my tests are running to use the appium 1.0 java client. This is working for the most part but when there is trouble getting an element the whole thing shuts down and its a error saying UIAutomator died, and need to check the logs. Here are my logs:
debug: Appium request initiated at /wd/hub/session/1b182ff6-886c-47a1-bc0b-8381f63a6ee8/element
debug: Request received with params: {"using":"xpath","value":"//android.widget.LinearLayout/android.widget.LinearLayout/android.widget.TextView[1]"}
info: Pushing command to appium work queue: ["dumpWindowHierarchy"]
info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"dumpWindowHierarchy","params":{}}
info: [BOOTSTRAP] [info] Got command of type ACTION
info: [BOOTSTRAP] [debug] Got command action: dumpWindowHierarchy
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [UIAUTOMATOR STDOUT] Error in testRunServer:
info: [UIAUTOMATOR STDOUT] java.lang.IllegalArgumentException: Illegal character (d83d)
info: [UIAUTOMATOR STDOUT] at org.kxml2.io.KXmlSerializer.reportInvalidCharacter(KXmlSerializer.java:144)
info: [UIAUTOMATOR STDOUT] at org.kxml2.io.KXmlSerializer.writeEscaped(KXmlSerializer.java:130)
info: [UIAUTOMATOR STDOUT] at org.kxml2.io.KXmlSerializer.attribute(KXmlSerializer.java:465)
info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.AccessibilityNodeInfoDumper.dumpNodeRec(AccessibilityNodeInfoDumper.java:107)
info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.AccessibilityNodeInfoDumper.dumpNodeRec(AccessibilityNodeInfoDumper.java:129)
... (more output)
info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.UiDevice.dumpWindowHierarchy(UiDevice.java:768)
info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.handler.DumpWindowHierarchy.execute(DumpWindowHierarchy.java:48)
info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.AndroidCommandExecutor.execute(AndroidCommandExecutor.java:97)
info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.runCommand(SocketServer.java:195)
info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.handleClientData(SocketServer.java:93)
info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.listenForever(SocketServer.java:137)
info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.Bootstrap.testRunServer(Bootstrap.java:17)
info: [UIAUTOMATOR STDOUT] at java.lang.reflect.Method.invokeNative(Native Method)
info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:160)
info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:96)
info: [UIAUTOMATOR STDOUT] at com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:91)
info: [UIAUTOMATOR STDOUT] at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
info: [UIAUTOMATOR STDOUT] at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
info: [UIAUTOMATOR STDOUT] at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
info: [UIAUTOMATOR STDOUT] at dalvik.system.NativeStart.main(Native Method)
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.E
info: [UIAUTOMATOR STDOUT] Time: 25.478
info: [UIAUTOMATOR STDOUT] FAILURES!!!
info: [UIAUTOMATOR STDOUT] Tests run: 1, Failures: 0, Errors: 1
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
info: UiAutomator exited
debug: executing: "/Users/patrick/opt/android-sdk-macosx/platform-tools/adb" -s T062804FI7 shell "echo 'ping'"
info: Attempting to uninstall app
debug: Not uninstalling app since server not started with --full-reset
info: Cleaning up android objects
info: Responding to client with error: {"status":13,"value":{"message":"UiAutomator died while responding to command, please check appium logs!","name":"UnknownError","origValue":"UiAutomator died while responding to command, please check appium logs!"},"sessionId":"1b182ff6-886c-47a1-bc0b-8381f63a6ee8"}
POST /wd/hub/session/1b182ff6-886c-47a1-bc0b-8381f63a6ee8/element 500 108ms - 300b
info: Cleaning up appium session
This isn't making much sense to me since it is running a command to push a button where it simply opens or closes a drawer, while the button is always visible. It's xpath does not change after the button is clicked. This command is actually failing on the second time it is clicked while the first click has no issue.
Anyone seen this before? Why would the automator die instead of just saying it had trouble getting the element? Everything up until this point works fine. I doubt this has to do with my xpath.
Just ran it again in debug and stopped the test from executing the last command that would cause the error, then tried to get the appium insepctor to show me the layout and that ended up breaking it with the same result:
debug: Appium request initiated at /wd/hub/session/e03bacc0-6c34-4ed5-8d3e-77e207bdd950/source
debug: Request received with params: {}
info: Pushing command to appium work queue: ["dumpWindowHierarchy"]
info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"dumpWindowHierarchy","params":{}}
info: [BOOTSTRAP] [info] Got command of type ACTION
info: [BOOTSTRAP] [debug] Got command action: dumpWindowHierarchy
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [UIAUTOMATOR STDOUT] Error in testRunServer:
info: [UIAUTOMATOR STDOUT] java.lang.IllegalArgumentException: Illegal character (d83d)
info: [UIAUTOMATOR STDOUT] at org.kxml2.io.KXmlSerializer.reportInvalidCharacter(KXmlSerializer.java:144)