Page tree
Skip to end of metadata
Go to start of metadata

This page guides a user to build a test case for Android devices using Appium Studio.

Connect the device

  1. Connect the device to your machine using a USB cable.

  2. If you work on a Windows machine make sure you have a USB driver installed (MAC machine doesn't require any driver). For an updated list of drivers see: http://developer.android.com/tools/extras/oem-usb.html

  3. The device should be "USB debugging" enabled.


You can use Genymotion emulator. Just start the emulator to make it ready to work with.

Add the device to the Studio

Click on the 'Add Device' icon and on 'Android'

Approve the Android Add Dialog

Open the device

Double click on the added device or click on the 'Open' icon. 

A device reflection should be opened.

Once a device is 'open' a device reflection is available. You can use this reflection screen to control the device.

Target Application

To select your application click on the 'Import' icon. Select your APK / IPA / APP file. Your application will be added to the application repository.

You can also use the EriBank demo application, available in the application repository.

Select the application you would like to work with.

Select capabilities

Once a device and an application are selected you can select another capability, that will set your test/application life-cycle.

The selected capabilities will affect 1. Recording, 2. Code generation, 3. Execution within the studio.

Record your test

Click on the 'Record' button.

Wait for the device to be prepared for recording.

Start to perform the operations on the device reflection screen.

Use your mouse to simulate touch and swipe actions, and your keyboard to send keys.

It is recommended to end your recording on the same page you have started the recording. It will enable easily cycled execution when you debug your script.

After you stop the recording the script is generated in the studio test tab.

You can add new commands and modify the existing commands and commands parameters.

You can verify your recording is valid by executing the recorded script. Just click on the 'Play' button.

Create new Appium project in eclipse (Gradle)

  1. Create a new Gradle project, File->New->Other...

  2. Select 'Gradle Project'
  3. Check the 'Create a simple project (skip archetype selection)' checkbox. Click the 'Next' button.
  4. Open the newly created project, open the build.gradle file that was created. Replace the generated content with the following:

    build.gradle
    apply plugin: 'java'
    apply plugin: 'maven'
    apply plugin: 'eclipse'
     
    repositories {
         maven { url "http://repo.maven.apache.org/maven2" }
         mavenCentral()
    }
    dependencies {
       compile group: 'io.appium', name: 'java-client', version: '+'
    }
  5. Run the clean, cleanEclipse and eclipse task to prepare your Eclipse environment.

Create a new Test class

  1. Right-click on your test source folder, select New->Class

  2. Provide the name of your test. (You can also provide a package that your test will be placed in). Click 'Finish'.

Export your test into Eclipse

In Appium Studio click on the 'Copy to Clipboard'  icon.

You can now paste your code into the new Java class you have created.



  • No labels