My query is working fine on calabash-android console but it is not working on my Xamarin code

15 views
Skip to first unread message

tagin...@gmail.com

unread,
Apr 19, 2017, 6:05:50 AM4/19/17
to calabash-android

So I have a text that I want to get from a popup

When I run on calabash-android the following query :

query("* id:'my_object_id', text")[0] 

Then I am getting the text that I want to check


But If i run on my code Xamarin : 
app.Query(c => c.Id("my_object_id")).Length; ==> I am getting 0
app.Query(c => c.Id("my_object_id"))[0].Text; ==> Null


I tried all other ways : 
app.Query(c => c.Marked("my_object_id"))[0].Text; ==> Null
app.Query(c => c.Class("TextView").Descendant().Id("my_object_id")).FirstOrDefault().Text; ==> Null


I finaly found a way to fix it, but I don't really like the solution : 
app.Query(c => c.Property("text").Contains("a small part of the text that I want to check")).Length; ==> I got 1
app.Query(c => c.Property("text").Contains("a small part of the text that I want to check"))[0].Text; ==> I am getting the full text that i want to check



Is there any explanation for this "wierd" behavior ?

Reply all
Reply to author
Forward
0 new messages