How to configure the test permission in AndroidManifest?

0

I have a question to give permission to test in an android application.

I created a test case but when running the following appears on the console:

  

does not specify a android.test.InstrumentationTestRunner   instrumentation or does not declare uses-library android.test.runner   in its AndroidManifest.xml

I went to the application's AndroidManifest.xml file and entered the code:

<instrumentation android:name="android.test.InstrumentationTestRunner"
    android:targetPackage="com.voxar.cameraapp"
    android:label="your tests label" />

and I put:

<uses-library android:name="android.test.runner" />

As suggested in the stackoverflow.com

How do I fix the errors so I can start testing?

    
asked by anonymous 05.05.2015 / 16:46

1 answer

1

@Daniel theoretically just add in your gradle file these dependencies.

androidTestCompile('com.android.support.test:runner:0.3') { exclude group: 'com.android.support', module: 'support-annotations' } androidTestCompile('com.android.support.test:rules:0.3') { exclude group: 'com.android.support', module: 'support-annotations' }

You do not need permission to run a simple test (change screens). If it is to access internet or GPS or SD Card, that kind of thing, then you need permission, otherwise you do not have to. Here is a link with instructions for you to start your tests. I hope I have helped

link

    
05.02.2016 / 18:55