Nate
Nate

Reputation: 19

Getting an element from ListView by index in Xamarin automated UI test

enter image description hereI have a ListView his automation Id = List and I want to Tap on the second element.

How can I tap on him with his index?

app.tap((automationId)[1]) //?

Upvotes: 1

Views: 1119

Answers (1)

chetan
chetan

Reputation: 132

In my case I have assign AutomationId to first View in side DataTemplate. so I can tap on particular cell by index.

This will get all Cells inside ListView :

app.Tap(c => c.Marked("TeamListCell"));   

You can tap on particular item by index like this :

app.Tap(c => c.Marked("TeamListCell").Index(0));   

Upvotes: 2

Related Questions