Vous êtes sur la page 1sur 18

Appium Setup

1. Download the JDK:


Screen#1:

Screen#2:

Screen#3:
2. Setup Environment variable for JDK
3. Download Android
Screen#1:

Screen#2:
Screen#3:

4. Setup Environment variables for Android


Note: There should be no space in folder name (Like My Android). If space is there then
Appium will not work.
Note: Appium support API Level 17 and so on. Appium will not support the API level that is
lower than 17. So if you have older version of Android phone then may be Appium will not work.
Note: If Developer Options is not in your phone under Settings then you have to click 6 times on
About Phone then Developer Options will come.
Note: If your phone is not detected by PC then you need to install PDAnet. If Phone ask for RSA
Key then accept it.
Screen#1:

Screen#2:

5. Download Node JS and install it.


Screen#1:
Screen#2:

6. Download Microsoft Framework and install it.


Screen#1:
Screen#2:

7. Donwload Appium
Screen#1:

Screen#2:
Screen#3:

Screen#4:
Screen#5:

Screen#6:

Start Appium Server


1. Click on Launch the Appium Node Server
Screen#1:

Screen#2:

Note: If you get any error while starting the Appium Server, just switch over one version back.

Running your first Appium program


1. Add Selenium External Jar
Screen#1:
Note: Also add the lib directory jars as well.

Screen#2:

2. Download the appium driver jar from www.Appium.io.


Screen#1:
Screen#2:
Screen#3:

3. Include this jar file in your eclipse project


4. Download the gson-2.2.4.jar as well and include this jar file in your eclipse project.
Screen#1:

5. Write the code like this


Screen#1:
Screen#2:

Trouble shooting:
1. Run the program
Error description: Failed to start an Appium session. Err was: Could not find zipalign in tools,
platform-tools, or supported build-tools
Screen#1:
This error is due to API version of phone and respective Android SDK build tool is not installed in
SDK Manager.
For example phones API level 19 (See the top line in Screen#1; debug Device is at API Level 19)
and that is not present in Android SDK Manager.
2. Install everything under Tools node
Screen#1:
3. Install correct Android version and API Level
Screen#1:

4. Stop, Close and Re-start Appium

Error Description: A new session could not be created. (original error: Requested a new session but
one was in progress) .

This error comes up when driver object is not quitted at the end of code.

Screen#1:
After this you have to re-start the Appium server as well.

Note: Every time you run the program in eclipse and if it runs successfully then it will delete the
respective application from your mobile and re-install it.

To prevent this, Stop the Appium Server, Go to Android Settings (first icon), Select the No Reset
check box.

If application is not present in device then you must uncheck the No Reset check box.

Screen#1:
Error Description: Logcat capture failed: spawn ENOENT

debug: Waiting for device to be ready and to respond to shell commands (timeout = 5)

> debug: executing: "D:\Sanjay\Sanjay\Automation Projects\Selendroid\resources\sdk\platform-


tools\adb.exe" -s emulator-5554 wait-for-device

> debug: executing: "D:\Sanjay\Sanjay\Automation Projects\Selendroid\resources\sdk\platform-


tools\adb.exe" -s emulator-5554 shell "echo 'ready'"

> debug: Starting logcat capture

> error: Logcat capture failed: spawn ENOENT

> debug: Stopping logcat capture

This error comes when there is space in folder name. E.g. D:\Sanjay\Sanjay\Automation Projects

Remove the space and set the Android path again in Environment Variables.

Starting Appium Server from command prompt:


1. Open the command prompt
2. Go to Appium downloaded folder path
3. Go to Appium\node_modules\appium\bin directory

4. Fire command node appium (without quotes)


Note: for every command you have to write node appium and then parameter.
E.g. node appium no-reset

Vous aimerez peut-être aussi