Robotframwork + appium+ andriod Environment construction

Source: Internet
Author: User

Rf+appium+android Environment Construction Tutorial

-

1.RF installation

First, the applicable operating system
WIN7 flagship SP1 32-bit operating system

For RF environment Construction, please refer to the Documentation "Robotframwork Installation Guide"

After the RF environment is set up, you need to refer to the third-party library "Appiumlibrary" library, this library can go to the official website address download (http://robotframework.org/#test-libraries)

Add Library method run cmd to the Appiumlibrary Library directory and run the command: Python setup.py install, just like the document "Robotframwork Installation Guide" To add a library method

Add Library method: Same as document "Robotframwork Installation Guide"

The above is the RF tool configuration

2.Android Environment Setup

2.1JDK installation (if the computer is installed, no installation is required; not installed, download the JDK and configure environment variables)

Install the JDK and configure the environment variable


The JDK installation is simple and can be installed by default.
Environment variable configuration:
Add Java_home variable, value: JDK installation path, such as: D:\Java\jdk1.7.0_45
Add Classpath variable, value.; %java_home%\lib\tools.jar;%java_home%\lib\dt.jar
Modify the path variable, plus this sentence%java_home%\bin;

Check that the Java environment is configured, enter the cmd command line, enter Java or JAVAC, you can see a lot of command prompt, indicating success.

2.2 Installing ADT

Installing ADT, configuring environment variables
: Http://developer.android.com/sdk/index.html?hl=sk
Download Adt-bundle-windows-x86-20140321.zip, directly decompression can.


Configure the environment variables, set the android_home system variable to your Android SDK path, and add tools and platform-tools two directories to the system's path path.
Variable name: Android_home value: D:\AUTOTEST\ADT\SDK
Set Path value:%android_home%\tools;%android_home%\platform-tools

2.3 Configure Android Virtual machine (self-equipped)

Click on the red box according to your needs, configure the Android phone system, hardware configuration

The above is the Android environment setup configuration

3.Appium installation (online installation (3.1~3.2) or download client (3.3) any one or both of them are installed

3.1node.js Installation

Install node. js, which is installed by default and can change the path of the installation.
After the installation is complete, check that the node version installation is successful: Enter cmd, enter node-v, you can see the version number, indicating success.

3.2Appium Networked Installation

Go to the cmd command line and enter:
NPM Install–g Appium or
NPM--registry http://registry.cnpmjs.org install-g appium (recommended this, NPM's domestic image)
Note:-G global parameters
Wait a few more minutes to see the Appium version 1.1.0 and the installation directory

Check to see if the Appium is installed successfully.
Go to cmd command line, enter Appium
Tip: Welcome to appium instructions are installed.

Check if the environment required for Appium is OK (this step is important)
Enter the cmd command line, enter Appium-doctor, and the following prompt appears, all Checks weresuccessful, stating that the environment is successful.

3.3Appium Windows Server server

Appium official website http://appium.io/

Go to the official website to download Windows Server

https://bitbucket.org/appium/appium.app/downloads/

Unzip the installation package to use

Click Appium.exe to start the report. The Netframe frame is not installed, or the version is low. The next frame is all right.

3.4 Install Appium-python-client: (This step is important, must)
Enter cmd, enter: Pip install appium-python-client

The above is the installation of Appium

4. Activate RF, Appium and Android simulator

4.1 Boot Order

Appium→android Simulator →RF

Example:

Start your Android phone's calculator

RF:

Settings * * *

Library appiumlibrary

Test Cases * * *

Test

Open application Http://localhost:4723/wd/hub platformname=android platformversion=4.3 devicename=emulator:5554 Apppackage=com.android.calculator2 appactivity=. Calculator

Capture Page screenshot

Python:

From Appium import Webdriver
Desired_caps = {}
desired_caps[' platformname ' = ' Android '
desired_caps[' platformversion ' = ' 4.2 '
desired_caps[' devicename ' = ' Android Emulator '
desired_caps[' apppackage '] = ' Com.android.calculator2 '
desired_caps[' appactivity '] = '. Calculator '
Driver = Webdriver. Remote (' Http://localhost:4723/wd/hub ', desired_caps)

Robotframwork + appium+ andriod Environment construction

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.