Loading a file from res folder in android test project -
In a test case I must load the picture that is available in the folder in my test project
/ myproject / res / drawable-hdpi / attachment.png
I used it by using InstrumentationTestCase and before saving the file in the / res / raw folder and loading it with it I have tried, but my attachment in the R file is not enclosed.
Reference test consensus = getInstrumentation (). GetContext (); InputStream input = testContext.getResources (). OpenRawResource (R.raw.exe)
Any ideas?
Thanks
You should not use raw, used to save pictures Known asset;)
Comments
Post a Comment