所以我有一个我想从弹出窗口获取的文本
当我在calabash-android上运行以下查询时:
query("* id:'my_object_id', text")[0]
然后我收到了我要检查的文字
但如果我运行我的代码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
我尝试了其他所有方法:
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
我最终找到了解决问题的方法,但我不太喜欢这个解决方案:
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
对此有什么解释" wierd"行为?