This page guides a user to build a test case for Android devices using Appium Studio.
Connect the device
Connect the device to your machine using a USB cable.
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
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.
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.
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)
- Create a new Gradle project, File->New->Other...
- Select 'Gradle Project'
- Check the 'Create a simple project (skip archetype selection)' checkbox. Click the 'Next' button.
Open the newly created project, open the build.gradle file that was created. Replace the generated content with the following:
- Run the clean, cleanEclipse and eclipse task to prepare your Eclipse environment.
Create a new Test class
- Right-click on your test source folder, select New->Class
- 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.