How to click on a button, which is indexed at 10 position in ListView - Robotium automation?

0
0

Suppose, I have a ListView, which contains 20 ListItems. Each item is having a button, now I want to click a button which is located at 10 position in ListView. How I can automate it via robotium?

  • You must to post comments
0
0

Try to do ti like this (not sure if it works)

//get the list view
ListView myList = (ListView)solo.getView(R.id.list);
//get the list element at the position you want
View listElement = myList.getChildAt(10);// myList is local var
//click on imageView inside that list element
solo
.clickOnView(solo.getView(listElement.findViewById(R.id.my_button)));// not double eE

Hope this helps !

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website