Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Robotium ClickOnButton(int ID) method causes "junit.framework.AssertionFailedError: Button with index 2131034130 is not available!"

I am using robotium for testing and can't figure out how to click buttons without text. Test fails with trace:

junit.framework.AssertionFailedError: Button with index 2131034130 is not available!

like image 261
insomniac Avatar asked Dec 09 '22 20:12

insomniac


1 Answers

The index system is there for black-box testing reasons So If you know the resource ID of the view you want to click you can use solo.getView(R.id) to get a hold of the object and then use solo.clickOnView(View view) to click it.

like image 118
Renas Avatar answered Dec 11 '22 11:12

Renas