How to configure Appium with android IDE & eclipse
1. How to configure Appium
with android IDE & Eclipse
Appium ver.0.1
Mobile
Automation
2. Check your mobile – Setting - about device
To know your android version and api level check this URL
https://source.android.com/setup/start/build-numbers
and compare with version on your mobile go to setting / about
device to check that.
3. Setup Android-Studio
• Download from https://developer.android.com/studio/
• Follow the Screen shots to finish installation successfully on your machine
• Setup Steps :
1. Click on the android-studio-ide-171.4443003-windows.exe
13. 11- Create a new project as following : after creation you will found
some errors in gradle in android studio, you will fix them by
download some files on this project.
Setup Android-Studio
14. 12- Target Android Devices : to select which device will test
it for example phone and tablet as image
Setup Android-Studio
15. 13- Select an activity for example
Setup Android-Studio
17. 15- Wait till Building App Gradle Project
Setup Android-Studio
18. 16- Confirm that VT-x is enabled in BIOS as Intel HAXM is required to
run this AVD.
Setup Android-Studio
19. 17 – Confirm the AVD Name as the following for example
Setup Android-Studio
20. Run Emulator from CMD
18- after finishing the configuration of Device and Android Build, we can run the
Emulator directly from CMD without need for the Android Studio Follow the steps:
• Make sure that Android Studio is closed
• Navigate to the Setup location and get the Emulator path, C:Users<User-
Name>AppDataLocalAndroidSdkemulator
• Run CMD
• Write the Command line :
[cd C:Users<UserName>AppDataLocalAndroidSdkemulator] Click Enter
• Write the Command [emulator -avd <Device-Name>] Click Enter
• Now Check that the emulator is running without run the Android Studio
• Drag and drop the required (.apk) on the running emulator to begin setup.
21. Run Appium Server
1. Download Appium version from [http://appium.io]
2. Click on Download Now, latest (1.5.0)
3. Select to Download the (.exe) version
4. Double click on the downloaded .exe
5. Wait till the installing is finished
6. Keep the settings as default, then Click on Start Server
7. Click on [Start Inspector Session] icon
8. Add Desired Capabilities, can click on link [Desired Capabilities
Documentation ] to check the required Capabilities.
23. 9- add the following in the JSON Representation section :
{
"platformName": "Android",
"platformVersion": "8.0",
"deviceName": "PixelXL-API26",
"app": "T:AppuimMobileAppiumAPKsselendroid.apk"
}
• Check that values equal to the created emulator properties (which
created on Android Studio previously)
10- Click on Start Session button.
Run Appium Server
24. 11- now check that the installed (.apk) is running on App Source
12- Locate the required elements to capture it’s properties such
(id, xpath, class name, …… etc).
13- open Eclipse IDE and create new project with new Package
(name it as Appium).
Run Appium Server
25. 14- Create a new class with the following capabilities [same as defined on Appium
Server] :
public void openApplication() throws MalformedURLException
{
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("platformName", "Android");
caps.setCapability("platformVersion", "8.0");
caps.setCapability("deviceName", "PixelXL-API26");
caps.setCapability("app", "T:AppuimMobileAppiumAPKsselendroid.apk");
AndroidDriver<WebElement> driver = new AndroidDriver<WebElement>(new
URL("http://0.0.0.0:4723/wd/hub"), caps);
}
Run Appium Server
26. 15- Now, run the code to make sure it connected to the specified
emulator.
Run Appium Server