简体   繁体   中英

Xamarin.UITest REPL. How to get list of objects from ListView element?

How can i get Length of "grid_table" element? I have the following REPL tree output: RELP树outuup

For now I can only get the "grid_table" element, but not its "container" elements or at least "grid_table" Length. Is it possible? Or I can only get elements by "container" Id?

To count all direct children for grid_table, use:

app.Query(q => q.Id("grid_table").Child()).Length

To count all elements with id 'container' that are descendants of "grid_table", you could use:

app.Query(q => q.Id("grid_table").Descendant().Id("container")).Length

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM