[英]Xamarin.UITest retrieve all element at view
I have couple of EditText
inputs at view. 我在视图中有几个
EditText
输入。 But a few of them is hidden under screen and need to scroll to see them. 但是其中一些隐藏在屏幕下方,需要滚动才能看到它们。 How can I get all
EditText
elements in my view (also this hidden under screen). 如何在视图中获取所有
EditText
元素(也隐藏在屏幕下方)。 I tried: 我试过了:
_app.Query(q => a.All().Class(EditText));
But returns much more elements than is visible (return 96 should be 12) What is the proper query? 但是返回的元素比可见的要多得多(返回96应该是12)正确的查询是什么?
Using the All() method changes the search query to return all the elements instead of just the visible ones. 使用All()方法可更改搜索查询以返回所有元素,而不仅仅是返回可见的元素。
The query to return just the visible elements with the EditText class would be as follows: 只返回带有EditText类的可见元素的查询如下:
_app.Query(x => x.Class("EditText"));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.