Xamarin.UITest REPL.如何从 ListView 元素获取对象列表? [英] Xamarin.UITest REPL. How to get list of objects from ListView element?

查看:52
本文介绍了Xamarin.UITest REPL.如何从 ListView 元素获取对象列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获得grid_table"元素的长度?我有以下 REPL 树输出:

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

现在我只能获得grid_table"元素,但不能获得它的容器"元素或至少是grid_table"长度.是否可以?或者我只能通过容器"ID获取元素?

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?

推荐答案

要计算 grid_table 的所有直接子级,请使用:

To count all direct children for grid_table, use:

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

要计算所有 id 为 'container' 的元素是grid_table"的后代,您可以使用:

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

这篇关于Xamarin.UITest REPL.如何从 ListView 元素获取对象列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆