Appium: How can I located RecyclerView to locate an Element

Viewed 1673

I am unable to locate Recycler view using Appium

Screenshot

When I try to locate the RecyclerView, the Appium server just halts. In this image (ListView) I want to check the checkbox which is highlighted in the image.

The approach I am using is findingElementbyid("Recyclerview") get its index and click on checkbox.

Can you please guide the right approach?

1 Answers

You need not find the recyclerView. You can do the following

@AndroidFindBy(xpath = "//android.widget.Button[@text='Primary Account']") private List primaryAccounts;

or

@AndroidFindBy(id= "com.ezepay:id/bMakePrimary") private List primaryAccounts;

Then, in order to click on a particular button, you can do the following click(primaryAccounts.get(index));

Related