Appium Environment Build Java Chapter

Source: Internet
Author: User
Tags install node appium testng

Appium test Environment setup steps:

1, download, install jdk& configuration Java environment variables

2. Download, install SDK, adt& Configure the Android environment variable

3, download, install Appiumforwindow

4, online installation testng, SVN, maven and other plug-ins

5, Appium simple case

1. Download, install jdk& Configuration Java Environment Variables

Jdk:http://www.oracle.com/technetwork/java/javase/downloads/index.html

To configure environment variables:

1. Right-click My Computer--Properties--advanced--environment variables

2. New System variables Java_home and Classpath

Variable name: java_home

Variable Value: C:\Program files\java\jdk1.7.0

Variable name: CLASSPATH

Variable value:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;

3. Select the environment variable named "path" in the "System variables", double-click the variable, add the absolute path of the bin directory in the JDK installation path to the value of the path variable, and delimit the semicolon with the half-width and the existing path.

Variable name: Path

Variable value:%java_home%\bin;%java_home%\jre\bin;

To verify that the configuration was successful: Reopen console input: Java-verison, if the Java version information is displayed, the installation is successful.

2. Download, install adt& Configuration Android Environment Variables

Adt:http://developer.android.com/sdk/index.html

Configure environment variables: 1, right-click My Computer--Properties--advanced--environment variables

2. Create a new Android_home variable in the system Variable field

Variable name: android_home

Variable value: E:\appium\adt-bundle-windows-x86_64-20131030\sdk\ (depends on the actual situation)

Append Platform-tools, Tools, and Build-tools to the path variable value in the same region, i.e. append "in path";%android_home%\build-tools\android-4.4\;%android_ Home%\tools\;%android_home%\platform-tools "can be copied and added. Note: android-4.4 is subject to availability

Final results

The Android_home configuration is as follows:

The system variable path is configured as follows:

3 , download, install Appiumforwindow

cmd version

Install node. js

: http://www.nodejs.org/

Environment variables:

1. Right-click My Computer--Properties--advanced--environment variables-User variables

Variable name: Path

Variable value: D:\nodejs\; d:\Users\lcding\AppData\Roaming\npm

2, networking installation appium into the cmd command line

Input: NPM install–g appium or npm--registry http://registry.cnpmjs.org install-g appium (recommended for this, NPM's domestic image)

If you need to install 1.2.4:NPM--registry http://registry.cnpmjs.org install-g [email protected]

Note:-G global parameters Wait a few minutes, you can see Appium version 1.xx.xx and installation directory

Check to see if the Appium is installed successfully. Go to the cmd command line and enter Appium hint: Welcome to Appium instructions are installed

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

EXE version

Download the Windows version of Appium address: https://bitbucket.org/appium/appium.app/downloads/Download and install

Note: The Appiumforwindow version requires Microsoft. NET Framework 4.5.1 support, which prompts the user to install and jump to the. NET Framework if no installation is installed during the Appium installation.

The Appium directory is as follows:

After successful installation, click "Appium.exe" to run the interface

Click the navigation "Launch" button to start the Appium remote server, if the startup is successful will prompt Appium related version information. Such as:

4 , online installation of Appium test required plug-ins

1. Installing the Software Library is Eclipse Marketplace

Eclipse->help->install New Software

Click on the "Add ..." button

Input Name:marketplace

Input location:http://download.eclipse.org/mpc/indigo/

Click on the "OK" button, select: Marketplace in the work with drop-down box, search for a period of time to list the installable options,

Tick the second one, click "Next", the next step to complete the installation, restart Eclipse to complete the installation. Installation Successful

Start Eclipse->help->eclipse Markteplace

Installation is successful!

2, Installation testng

Open Eclipse Marketplace in the search box, enter testng, click the Search button

Click the Install button on the right to complete the installation and restart Eclipse to create a new testng Class.

3. Install Maven

Open Eclipse Marketplace in the search box, enter testng, click the Search button

You can create a new maven Project by tapping the right-click Install button to complete the installation and restart Eclipse. SVN is no longer a statement of the same.

To configure the MAVEN environment variable:

System variable: maven_home = D:\Server\maven

System variable: PATH =%maven_home%\bin

5 , Appium Simple Case

1. New maven Project:

Click "Next":

Enter: Group ID, Artifact ID (i.e. project name), Pakcage and other information, click "Finish" button to create a new success.

Project directory Structure

Replace Pom.xml:

<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xsi: schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > < Modelversion>4.0.0</modelversion> <groupId>com.ctrip.view</groupId> <artifactId> Learntest</artifactid> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging > <name>LearnTest</name> <url>http://maven.apache.org</url> <properties> < Project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> <dependencies      > <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId>      <version>4.11</version> <scope>test</scope> </dependency> <dependency> <groupId>io.appium</groupId> <artifactid>java-client</artifactid> <version>2.1.0</version> </dependency> <dependency> <groupid>org .testng</groupid> <artifactId>testng</artifactId> &LT;VERSION&GT;6.8&LT;/VERSION&G        T            </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>LATEST</version> </dependenc Y> </dependencies></project>

  

Automated Test Preparation pre-run conditions:

1. Appium is started and is already in Lancuh state

2. The device is connected and unlocked

3. Software to be tested has been installed

If three conditions are OK, switch to Eclipse Editor, select Project file, right-->run as to run automated test

During the operation, it is found that the Appium console continuously outputs various information.

Appium Environment Build Java Chapter

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.