irb(main):004:0> query("* marked:'test_list' child * index:0 descendant * id:'test_list_item'")
[
[0] {
"class" => "android.widget.LinearLayout",
"tag" => nil,
"description" => "android.widget.LinearLayout{233d1ca6 V.E...C. ........ 0,126-1248,386 #7f0a0348 app:id/test_list_item}",
"id" => "test_list_item",
"visible" => true,
"rect" => {
"height" => 260,
"width" => 1248,
"y" => 422,
"x" => 64,
"center_x" => 688,
"center_y" => 552
},
"enabled" => true,
"contentDescription" => nil
}
]
irb(main):005:0> query("* marked:'test_list' child * index:0 descendant * id:'test_list_item'")
[]
irb(main):006:0> query("* marked:'test_list' child * index:0 descendant * id:'test_list_item'")
[]
irb(main):007:0> query("* marked:'test_list' child * index:0 descendant * id:'test_list_item'")
[
[0] {
"class" => "android.widget.LinearLayout",
"tag" => nil,
"description" => "android.widget.LinearLayout{233d1ca6 V.E...C. ........ 0,126-1248,386 #7f0a0348 app:id/test_list_item}",
"id" => "test_list_item",
"visible" => true,
"rect" => {
"height" => 260,
"width" => 1248,
"y" => 422,
"x" => 64,
"center_x" => 688,
"center_y" => 552
},
"enabled" => true,
"contentDescription" => nil
}
]
Notice that the same query is sometimes returning empty results when they ran on the same view.
Here are some of the observations that I've made:irb(main):005:0> query("* marked:'test_list' child * index:0 descendant * id:'test_list_item'")
= Request
! CONNECT TO 127.0.0.1:34780
! CONNECTION ESTABLISHED
POST //map HTTP/1.1
Content-Type: application/json;charset=utf-8
User-Agent: HTTPClient/1.0 (2.4.0, ruby 2.0.0 (2014-05-08))
Accept: */*
Date: Tue, 28 Apr 2015 00:46:54 GMT
Content-Length: 138
Host: 127.0.0.1:34780
{"query":"* marked:'test_list' child * index:0 descendant * id:'test_list_item'","operation":{"method_name":"query","arguments":[]}}
= Response
HTTP/1.0 200 OK
Content-Type: application/json;charset=utf-8
Date: Tue, 28 Apr 2015 00:46:53 GMT
{"results":[{"class":"android.widget.LinearLayout","tag":null,"description":"android.widget.LinearLayout{3e5ac387 V.E...C. ........ 0,111-1272,339 #7f0a0348 app:id/test_list_item}","id":"test_list_item","visible":false,"rect":{"height":228,"width":1272,"y":46,"x":393,"center_x":1029,"center_y":160},"enabled":true,"contentDescription":null}],"outcome":"SUCCESS"}! CONNECTION CLOSED
[
[0] {
"class" => "android.widget.LinearLayout",
"tag" => nil,
"description" => "android.widget.LinearLayout{3e5ac387 V.E...C. ........ 0,111-1272,339 #7f0a0348 app:id/test_list_item}",
"id" => "test_list_item",
"visible" => false,
"rect" => {
"height" => 228,
"width" => 1272,
"y" => 46,
"x" => 393,
"center_x" => 1029,
"center_y" => 160
},
"enabled" => true,
"contentDescription" => nil
}
]
irb(main):006:0> query("* marked:'test_list' child * index:0 descendant * id:'test_list_item'")
= Request
! CONNECT TO 127.0.0.1:34780
! CONNECTION ESTABLISHED
POST //map HTTP/1.1
Content-Type: application/json;charset=utf-8
User-Agent: HTTPClient/1.0 (2.4.0, ruby 2.0.0 (2014-05-08))
Accept: */*
Date: Tue, 28 Apr 2015 00:46:56 GMT
Content-Length: 138
Host: 127.0.0.1:34780
{"query":"* marked:'test_list' child * index:0 descendant * id:'test_list_item'","operation":{"method_name":"query","arguments":[]}}
= Response
HTTP/1.0 200 OK
Content-Type: application/json;charset=utf-8
Date: Tue, 28 Apr 2015 00:46:55 GMT
{"results":[],"outcome":"SUCCESS"}! CONNECTION CLOSED
[]