[ruby_lib] source - throwing parse exception

188 views
Skip to first unread message

Satyajit Malugu

unread,
Aug 13, 2013, 12:27:12 PM8/13/13
to appium-...@googlegroups.com, co...@bootstraponline.com
Though I am still able to interact with page elements I am getting this error

source
get /source
JSON::ParserError: A JSON text must at least contain two octets!
from /Users/malugus/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/json-1.8.0/lib/json/common.rb:155:in `initialize'

on any page. 

bootstrap online

unread,
Aug 13, 2013, 12:59:58 PM8/13/13
to Satyajit Malugu, appium-...@googlegroups.com, co...@bootstraponline.com
Are you using Selendroid?
> --
> 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/groups/opt_out.

Satyajit Malugu

unread,
Aug 13, 2013, 1:13:47 PM8/13/13
to appium-...@googlegroups.com, Satyajit Malugu, co...@bootstraponline.com
no this is android

bootstrap online

unread,
Aug 13, 2013, 1:16:59 PM8/13/13
to Satyajit Malugu, appium-...@googlegroups.com, co...@bootstraponline.com
It works for me. If you check the Appium server logs, is it sending an
empty response? Usually that error means there's no JSON to parse.

Satyajit Malugu

unread,
Oct 3, 2013, 7:38:36 PM10/3/13
to appium-...@googlegroups.com, Satyajit Malugu, co...@bootstraponline.com
Turns out I was using a API 16 level device when this happened. But currently I am also getting this on 4.3, which I suppose is API level 18. This is a tablet nexus 7 though.

Any thoughts?

bootstrap online

unread,
Oct 3, 2013, 9:07:21 PM10/3/13
to Satyajit Malugu, appium-...@googlegroups.com, co...@bootstraponline.com
Does uiautomatorviewer work? I'm testing against API 18 and the source
command doesn't error.

Satyajit Malugu

unread,
Oct 4, 2013, 1:10:45 AM10/4/13
to appium-...@googlegroups.com, Satyajit Malugu, co...@bootstraponline.com
Well UIautomatorviewer didn't work for this tablet (nexus 7) but I haven't tried the same for nexus 4
Nexus 4 which is 4.3 level 18 is working alright for me. 

bootstrap online

unread,
Oct 4, 2013, 9:04:06 AM10/4/13
to Satyajit Malugu, appium-...@googlegroups.com, co...@bootstraponline.com
I'll need the appium server logs to debug further.

Satyajit Malugu

unread,
Oct 4, 2013, 2:25:07 PM10/4/13
to appium-...@googlegroups.com, Satyajit Malugu, co...@bootstraponline.com
This is what i see, now that you ask for it bolded seems like a problem.

debug: Appium request initiated at /wd/hub/session/c67e60e3-b158-48d6-80fe-f07416ca942d/source
info: Pushing command to appium work queue: ["dumpWindowHierarchy"]
info: [ADB] Sending command to android: {"cmd":"action","action":"dumpWindowHierarchy","params":{}}
info: [ANDROID] [info] Got data from client: {"cmd":"action","action":"dumpWindowHierarchy","params":{}}
info: [ANDROID] [info] Got command of type ACTION
info: [ANDROID] [debug] Got command action: dumpWindowHierarchy
info: [ANDROID] [info] Returning result: {"value":true,"status":0}
info: [ADB] Received command result from bootstrap
debug: transferPageSource command: "/usr/local/opt/android-sdk/platform-tools/adb" -s 0498d9c9 pull /data/local/tmp/dump.xml "/var/folders/_c/g17xmxgj48x28v_vsrsg0v7x9jw4zp/T/11394-31291-1sqkhlt.xml"
warn: remote object '/data/local/tmp/dump.xml' does not exist
info: Responding to client with success: {"status":0,"value":"","sessionId":"c67e60e3-b158-48d6-80fe-f07416ca942d"}
GET /wd/hub/session/c67e60e3-b158-48d6-80fe-f07416ca942d/source 200 83ms - 87

bootstrap online

unread,
Oct 4, 2013, 2:34:12 PM10/4/13
to Satyajit Malugu, appium-...@googlegroups.com, co...@bootstraponline.com
The xml is not being created so this problem doesn't have anything to
do with the ruby code. You're sure that uiautomatorviewer works? If
the xml fails to dump then I would expect it to fail also.

The code that creates dump.xml is one line:
https://github.com/appium/appium/blob/master/android/bootstrap/src/io/appium/android/bootstrap/handler/DumpWindowHierarchy.java#L28

bootstrap online

unread,
Oct 4, 2013, 2:35:25 PM10/4/13
to Satyajit Malugu, appium-...@googlegroups.com, co...@bootstraponline.com
Reply all
Reply to author
Forward
0 new messages