I am working on automation testing of the Android app using Espresso. I am not able to perform click action on some image views on recycler view. I have tried to perform click by retrieving the required image view by going through its hierarchy but I am getting 'android.view.ViewRootImpl$CalledFromWrongThreadException' exception while performing click action which is working fine on other recycler views. I also tried to perform click by getting coordinates of the image view. I have tried some solutions through the following links:
Android Instrumentation Testing - UI Thread Issues Click by bounds / coordinates