Hom press second button with id:inf?

34 Views Asked by At

I use Testdroid, it based on junit3. Command:

solo.clickOnView(solo.findViewById("cc.app.R.id.inf"));

open first button with id:inf

  1. what command need use to press on second(third and more) button with id:inf.
  2. how select area/layout, where junit try found element with id:inf, something like that:

Here use command to chose LinearLayout by index and then

solo.clickOnView(solo.findViewById("cc.app.R.id.inf"));

enter image description here

1

There are 1 best solutions below

0
On

You can get/find LinearLayout view by index with methods:

getView(int id,int index)
getView(Class<T> viewClass, int index)
...

Then you can use method(s):

getViews(android.view.View parent)
getCurrentViews(Class<T> classToFilterBy, android.view.View parent)

which returns list of views, so filtering must be done by your code/helper method.