Appium Environment Build Java Chapter

Source: Internet
Author: User
Tags install node appium testng

1, download, install jdk& configuration Java environment variables

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

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 SDK, adt& Configure the Android environment variable

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)

3. Select the environment variable named "Path" in "System variables" and double-click the variable

Variable Name: path

Variable value:;%android_home%\build-tools\android-4.4\;%android_home%\tools\;%android_home%\ Platform-tools (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 Appium

cmd version

Install node. js

: http://www.nodejs.org/

1. Configure Environment variables:

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 Appium test required plug-in

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 MAVEN, 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. Git is no longer a statement.

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:

12345678910111213141516171819202122232425262728293031323334353637383940 <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>            <version>6.8</version>        </dependency>        <dependency>            <groupId>org.seleniumhq.selenium</groupId>            <artifactId>selenium-java</artifactId>            <version>LATEST</version>        </dependency>  </dependencies></project>
5, Appium simple case

Automated Test Preparation pre-run conditions:

1. Appium is started and is already in Lancuh state

2, the device is connected

If two 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.