Monday, 25 January 2016

Appium set-up with Android Studio



 If you are developing for android and if android studio is already installed than you can go ahead and write Appium tests in Android Studio too.
Limitation is it supports API 17 and more.

You can create a new project or you can use your existing project .
1.Create a New project : How to create Android Project
2.Add jar files to the project lib folder. JAR files are also available here
Copy all the jar files and paste in lib folder








3.Select all the jar files ->Right click ->Add as Library ->Synch Project with Gradle files(
click on Synch Now)
These dependencies are specified in build.gradle of the app.
dependencies {

      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:22.2.1'
      compile 'com.android.support:design:22.2.1'
      testCompile 'org.mockito:mockito-core:1.9.5'
      compile files('libs/hamcrest-core-1.3.jar')
      compile files('libs/apache-mime4j-0.6.jar')
      compile files('libs/guava-18.0.jar')
      compile files('libs/gson-2.3.1.jar')
      compile files('libs/commons-codec-1.10.jar')
      compile files('libs/commons-collections-3.2.1.jar')
      compile files('libs/commons-exec-1.3.jar')
      compile files('libs/commons-io-2.4.jar')
      compile files('libs/commons-lang3-3.4.jar')
      compile files('libs/commons-logging-1.1.3.jar')
      compile files('libs/httpclient-4.4.1.jar')
      compile files('libs/httpcore-4.4.1.jar')
      compile files('libs/httpmime-4.4.1.jar')
      compile files('libs/selenium-java-2.47.1-srcs.jar')
      compile files('libs/selenium-java-2.47.1.jar')
      compile files('libs/commons-validator-1.4.1.jar')
      compile files('libs/java-client-3.2.0.jar')
}























4.Exclude this packages too to avoid error in gradle build.
   Add this in build.gradle file of the app.Synch Project with Gradle files(click on Synch Now)
   packagingOptions {

  exclude 'META-INF/DEPENDENCIES.txt'

  exclude 'META-INF/DEPENDENCIES'

  exclude 'META-INF/dependencies.txt'
  exclude 'META-INF/LICENSE.txt'
  exclude 'META-INF/LICENSE'
  exclude 'META-INF/license.txt'
  exclude 'META-INF/LGPL2.1'
  exclude 'META-INF/NOTICE.txt'
  exclude 'META-INF/NOTICE'
  exclude 'META-INF/notice.txt'}


5. Now you can write your first Test case:
   First create the folder->click main in app folder->Right click on the package ->Click on 'create Java    Class'
    

1 comment:

  1. Casinos with Casino with Casino without Deposits
    Casinos with Casino Without Deposits: How 저녁밥 추천 to Create an Account 블랙 잭 사이트 on Mobile! Casinos 헐리우드 노출 without deposits for this 바카라 확률 page will win bet win show you how you can

    ReplyDelete