[Android-appium]: Android Automation test: Environment Preparation

Source: Internet
Author: User

Android Automated Testing: Preparing the Environment:

Before doing the Android Automation test, you need to prepare the following environment on your computer, I use Appium to do the automated test.

    1. Install Appium server, installation path: http://appium.io/https://bitbucket.org/appium/appium.app/downloads/
    2. Appium need node JS, so need to install it, installation path: https://nodejs.org/en/after installation, you can open cmd, input node–v, if you can display the version of node, prove the successful installation.

Once installed, you can open Appium and start it, such as:

    

    1. Install Java JDK (Android is a Java-based development), installation path: http://www.oracle.com/technetwork/java/javase/downloads/index.html

After installation, you need to configure environment variables

      

      • Java_home

C:\Program files\java\jdk1.8.0_101 (Installation path)

      • CLASSPATH

.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;

      • Path +

%java_home%\bin;%java_home%\jre\bin;

    1. Install Android SDK, installation path: https://developer.android.com/studio/index.html?gclid= Cjwkeajwmms-brcm5dn51jlbp1wsjacc61tfag0zqtzdgsydobbwbc1tkrebc1z_tn6qqtbq5lje0bocnddw_wcb

You will also need to configure environment variables after installation:

  • android_home

E : \development\android\android-sdk ( installation path )

      
  • path +

%android_home%\ Platform-tools;%android_home%\tools;

    • Android_home

E:\DEVELOPMENT\ANDROID\ANDROID-SDK (Installation path)

    • Path +

%android_home%\platform-tools;%android_home%\tools;

    1. Open the Android SDK installation path, SDK Manager.exe, open it, update the Android SDK, select the tool that needs updating, click Install Packages

    

    1. Configure Android Emulator: Open the Android SDK installation path, find the AVD Manager.exe, open it, click Create, and then build the emulator (choose Device, Target,cpu ...)

    

    1. When everything is ready, open VS and install the following package

Open Tools, Neget Package Manager, package manage console

    • Install-package Appium.webdriver
    • Install-package Selenium.webdriver
    • Install-package Selenium.support
    • Install-package Newtonsoft.json

You can then write the automation test case.

Several of these important ADB commands:

    • ADB devices---Examples of all device
    • ADB install <path_to_apk>-installs the package to device
    • ADB Push < Local path >< remote path >---Copying files from your computer to device
    • ADB pull < remote path >< Local path >---Copy files from device to PC
    • ADB shell--View files

Using CMD to create environment

    1. Install Appium server, install path:http://appium.io/
    2. Install the Node JS, install path:https://nodejs.org/en/
    3. Open the Appium server
    4. Start the Appium server
    5. Install the Java JDK, install path:http://www.oracle.com/technetwork/java/javase/downloads/index.html
    6. Install the Android SDK, install PATH:HTTPS://DEVELOPER.ANDROID.COM/STUDIO/INDEX.HTML?GCLID=CJWKEAJWMMS-BRCM5DN51JL Bp1wsjacc61tfag0zqtzdgsydobbwbc1tkrebc1z_tn6qqtbq5lje0bocnddw_wcb
    7. ADD environment variables for Java and Android SDK, like the below screen shot:
    1. Create Android Emulator
    2. Start Emulator
    3. Install the PowerApp SDK
    4. Run PowerApp Test Cases

We can execute the below CMD to create the above step at WTT:

The step 1,2,5,6, we can copy the files and install it.

The Step 3, CMD: "C:\Program Files (x86) \appium\appium.exe"

The step 4:cmd: "C:\Program Files (x86) \appium\node_modules\.bin\appium.cmd"-A 127.0.0.1-p 4723

The step 7:we can change the registry value and see the below-screen shot:

The step 8:cmd:android create Avd-n emulatorname-t 7-b default/x86 (details, please refer to:http://blog.sina.com . cn/s/blog_4d353ac3010186c4.html)

The Step 9:cmd:emulator-avd avdname (go to the Android SDK tools path Firstly)

The Step 10:cmd:adb install ***.SDK

[Android-appium]: Android Automation test: Environment Preparation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.