aws-samples / aws-device-farm-sample-app-for-android

AWS Device Farm sample Android app
Apache License 2.0
171 stars 202 forks source link

How to run test cases for multiple activities #17

Open Gaurav-sengar opened 5 years ago

Gaurav-sengar commented 5 years ago

Hello Guys,

I am new to espresso and i am able to run single test cases for an activity successfully what if i have multiple activities to test. The espresso is unable to find the view getting below mentioned error:

androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: with id: com.fourtek.phonebook:id/llListItem

nikhil-dabhade commented 5 years ago

@Gaurav-sengar Thank you for reporting this issue. Have you tried out "custom environment" feature? We believe this might solve your problem. Feel free to read more about it here: https://docs.aws.amazon.com/devicefarm/latest/developerguide/custom-test-environments.html

Likewise, can you provide a run URL for your failed run? We can debug it further if you provide this.

nikhil-dabhade commented 5 years ago

@Gaurav-sengar Also, at times some tests fail because they could not find the view which seems to be the case here. Have you tried experimenting with adding delays or making sure that the tests wait for the element to be rendered before performing an action on it.