Search code examples
c#xamarinui-testingxamarin.uitest

Xamarin.UITest retrieve all element at view


I have couple of EditText inputs at view. 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). 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?


Solution

  • Using the All() method changes the search query to return all the elements instead of just the visible ones.

    The query to return just the visible elements with the EditText class would be as follows:

    _app.Query(x => x.Class("EditText"));