Failure/crash from IllegalArgumentException: Illegal character

615 views
Skip to first unread message

Patrick L

unread,
May 7, 2014, 2:20:59 PM5/7/14
to appium-...@googlegroups.com
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)

Jonathan Lipps

unread,
May 8, 2014, 9:35:37 AM5/8/14
to Patrick L, appium-...@googlegroups.com
It looks like what's happening is that when we're using UiAutomator to generate the source XML (which is what enables XPath queries), it's running into a bad character in the XML.

This sounds like a bug in UiAutomator itself. Can you get the XML source at all? If you can, paste it here. I'd imagine it fails in the same way though.

--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/d/optout.

bootstrap online

unread,
May 8, 2014, 9:44:32 AM5/8/14
to Jonathan Lipps, Patrick L, appium-...@googlegroups.com

Patrick L

unread,
May 8, 2014, 10:32:04 AM5/8/14
to appium-...@googlegroups.com, Patrick L
Jonathan I cannot get the xml. This triggers the same issue when I do "driver.getPageSource();"
Based on bootstraponline's comment this could be related to international characters?

Jonathan Lipps

unread,
May 8, 2014, 10:32:56 AM5/8/14
to Patrick L, appium-...@googlegroups.com
Yes, and if so it might be a UiAutomator/Android bug :-(

On May 7, 2014, at 7:20 PM, Patrick L <pjl...@gmail.com> wrote:

bootstrap online

unread,
May 8, 2014, 10:36:51 AM5/8/14
to Jonathan Lipps, Patrick L, appium-...@googlegroups.com
I suggest opening an issue on the Android project so they fix this in
uiautomator.
https://code.google.com/p/android/issues/list

bootstrap online

unread,
May 8, 2014, 10:38:41 AM5/8/14
to Jonathan Lipps, Patrick L, appium-...@googlegroups.com

Patrick L

unread,
May 8, 2014, 10:58:03 AM5/8/14
to appium-...@googlegroups.com, Jonathan Lipps, Patrick L
We are working on a messaging app here. Found out that its the emoji that breaks the xml dump. I filed a ticket for the devs to investigate escaping them properly and hope this resolves it.
Reply all
Reply to author
Forward
0 new messages