How to use Robotium with Android Studio? -


robotium android test automation framework has full support native , hybrid applications.

now android studio de facto ide android development, i'm interested try android studio. however, couldn't find way set up.

how setup , use robotium test android studio?

guide:

  1. add following line dependencies section of inner build.gradle file (this file located @ same level src folder), change version name if required:

    androidtestcompile 'com.jayway.android.robotium:robotium-solo:5.2.1' 

    if reason don't want let gradle download dependencies can add them manually: place robotium.jar libs folder. right click , select add library...

  2. in src folder create folder androidtest

  3. inside create java folder
  4. (optional step, see below) inside create package test source same name app’s package name (or add ".tests" end.)
  5. place cursor (in editor window) @ class name inside 1 of files want test (e.g. mainactivity) , press alt+enter.
  6. select create test. select proper superclass robotium:

    android.test.activityinstrumentationtestcase2 
  7. android studio create test file , package (if wasn’t created in step 6)
  8. how run test:

    • ui: usual using android studio run menu
    • console: in terminal enter following command:

      ./gradlew connectedandroidtest 

      the html-reports generated @ "yourapp/yourapp/build/outputs/reports/androidtests/ connected/index.html"


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -