0

I'm using Robotium to do some automated testing on an OEM application and I am having trouble using the resource ID's. From what I understand, to use a resource id, you need to do something like this:

ImageView imageView = (ImageView) solo.getView(R.id.appicon); 

My question is: do I have to import the AUT resources folder into my test project in order to use the resource id's when I test?

Thanks!

BlackHatSamurai
  • 23,275
  • 22
  • 95
  • 156

2 Answers2

1

You can use it without import the AUT resources folder like this:

Activity act=solo.getCurrentActivity();
ImageView imageView = (ImageView) solo.getView(act.getResources().getIdentifier("appicon", "id", act.getPackageName())); 
Rais Alam
  • 6,970
  • 12
  • 53
  • 84
0

In order to use the resource id's with Robotium, you need to make sure you add the AUT to the test projects build path.

BlackHatSamurai
  • 23,275
  • 22
  • 95
  • 156