I. Appium+robotframework+jenkins Environment installation

Source: Internet
Author: User

I. Installing the Android Development environment installation

1.studio64.exe Installation: Reference http://www.cnblogs.com/fnng/p/4552438.html

2. Download the SDK via Androidstudio:

My download path is: D:\Android (new) \appdata\local\android\sdk\platforms

Two. Selection of simulator

Select one: Using Eclipse (ADT), use the Eclipse's own simulator (note: Eclipse is not ready to install the SDK, you can download the SDK via Androidstudio, and then copy to the installation directory for Eclipse (ADT): E:\ adt-bundle-windows-x86-20130917.467161976\adt-bundle-windows-x86-20130917\sdk\platforms) Installation Reference:/HTTP Www.cnblogs.com/fnng/p/4552438.html

Option two: Install through http://www.android-studio.org/, Andriodstudio Simulator in memory ratio is large

Select three: Genymotion simulator (genymotion Simulator is recommended, you can choose Android version)

1. Install app will error such as: genymotion problem of an error occurred while deploying a file Install_failed_no_machine_abis:
Problem Analysis: Nstall_ Failed_no_matching_abis is when you install an app with a local library, your CPU architecture is not, for example, if you compile a armv7 app, put it on the Inter architecture emulator, he will not work. In fact, the real reason is like an app designed for the arm architecture of the CPU, you put on a inter architecture of the phone, installation is wrong. In fact, this can be known through Eclipse, Simulator is the choice of simulator with different architectures. Genymotion is also the same, itself directly drag an arm under the app in the past he is not supported.
Workaround: So there's a compatible thing called--genymotion-arm-translation: Resources free Download: http://download.csdn.net/detail/iaiti/ 8224603, drag the compression package to the emulator installation restart emulator to

2. Error: C:\USERS\596555>ADB start-server
ADB server version (+) doesn ' t match this client (36); Killing ...
Error:could not install *smartsocket* listener:cannot bind to 127.0.0.1:5037:
Typically, each socket address (Protocol/network address/port) is allowed to be used only once. (10048)
Could not read OK from ADB Server
* Failed to start daemon *
Error:cannot Connect to Daemon
Workaround: Originally genymotion in the ADB command is occupied conflict, directly open the Genymotion setting, switch to the Fourth tab (ADB), select Use custom Android SDK tools, Then select the SDK path that we developed to use. (Reference: http://blog.csdn.net/guijiaoba/article/details/51034695)


Select four: Night God simulator

Three. Appium Installation

1. Install node. JS First:
node. JS Official website: https://nodejs.org/. When the installation is complete, open the Windows command prompt, and enter the "NPM" command. NPM is a node package management and distribution tool that has become an unofficial standard for publishing node modules (packages). With NPM, you can quickly find the packages you want to use for a particular service, download, install, and manage the packages you have installed.

2. Install Appium:
A. Method one. Appium is installed below via node. JS's npm.
C:\USERS\FNNGJ>NPM install-g Appium--of course, this kind of appium will be very slow, in order to respect the official online introduction, and most of the appium related materials will also introduce this installation method.

B. Method two. We can download the corresponding Appium version of the operating system on the Appium official website.
https://bitbucket.org/appium/appium.app/downloads/, Baidu Network disk download link: http://pan.baidu.com/s/ 1jGvAISu Unzip the downloaded appiumforwindows_1_4_0_0.zip (note: The installation Appiumforwindows_1_4_16_1 may report the. NET Framework 4.5: Baidu ". Net Framework 4.5 "for download and installation. Start Appium again. )

3.Appium Configuration and Startup:
The A.appium configuration is as follows:
Application path: Tick, select your app path
Platform Name: Select Android
Automation Name: Select Appium
Platformversion: Select the Android version for the simulator
DeviceName: Enter the name of your simulator
B. Start Appium
Launching Appium server with Command:d:\appium\node.exe lib\server\main.js--address 127.0.0.1--port 4723--app E:\SASP_ Package--avd HTC--platform-name Android--platform-version--automation-name Appium--device-name "HTC"--log-no-col Or
> Info:welcome to Appium v1.4.16 (rev. ae6877eff263066b26328d457bd285c0cc62430d)
> Info:appium REST HTTP Interface listener started on 127.0.0.1:4723
> Info: [debug] Non-default server args: {"app": "E:\\sasp_package", "Address": "127.0.0.1", "lognocolors": True, "AVD" : "HTC", "DeviceName": "HTC", "PlatformName": "Android", "platformversion": "All", "Automationname": "Appium"}
> Info:console loglevel:debug
(The above information indicates successful connection)

4.Appium Update: If you have node. js installed, then cmd input npm update-g appium

Four. RFS installation

(Prerequisite: RFS has been installed.)
1. Install appium-python-client-0.22:
It is recommended to use PIP installation pip install Appium-python-client
However, you can also download the source installation on pipy:
TAR-XVF appium-python-client-x.x.tar.gz (7zip can be decompressed on Windows)
CD appium-python-client-x.x
Python setup.py Install
Appium_python_client Introduction
Appium's practical methods are hidden in the client's source code, for driver and webelement instances, there is a corresponding element lookup method (Webelement look for the following sub-element), some children specifically for the function of the cell phone, You need to use this client after installation.
(The following is transferred from: http://testerhome.com/topics/1166)
Appium in order to implement its own Find method, the first custom of a Mobileby class, the class object is plugged into its definition of some of the extended properties, the values of these properties will be pushed to the server side by Webdriver protocol to identify and execute, In order for these attributes to be applied to the Find method, Appium well inherits and extends the Webdriver. Remote, and then implements the element lookup by invoking the driver instance's find_element and find_elements two core methods, so, since it is an extension, The Appiumdriver instance can use all of the Seleniumdriver's instance methods for element lookups, and their list can be sorted out.
Use of Appium_python_client
Once the installation is complete, you can use it for reference. We usually refer to Webdriver by using the following command:
From selenium import Webdriver
But we're going to use the functions in appium_python_client, and we're going to change to the following reference method:
From Appium import Webdriver
Then initialize the driver in the setup () function as follows:
Self.driver=webdriver. Remote (' Http://localhost:4723/wd/hub ', desired_caps)
You can call Appium's Special Method!!

2.robotframework-appiumlibrary-1.3.5 Installation:
It is recommended to use PIP installation pip install Robotframework-appiumlibrary
However, you can also download the source installation on pipy:
TAR-XVF robotframework-appiumlibrary-x.x.tar.gz (7zip can be decompressed on Windows)
CD robotframework-appiumlibrary-x.x
Python setup.py Install

Five. Appium+rfs use

1. Turn on the simulator

2. First configure the Appium, open the Appium service

3.RFS use
Load Appiumlibrary

Open your App

There are a variety of other keywords, if you can not encapsulate the library you want to load in.

Perform

Simulator Display Results

Six. About page element positioning

1. Positioning the H5 page element
A. Configure Google hosts: specific reference https://laod.org/hosts/2016-google-hosts.html
B. Open the emulator, enter the address: chrome://inspect/#devices, you can locate

Click Inspect

C. If not, the code cannot be loaded, then use the ChromeGAE7.4 Proxy

2. For native apps:
With D:\Android (new) \appdata\local\android\sdk\tools under the Uiautomatorviewer.bat or Hierarchyviewer.bat can, of course, can also be used by Google inspect

Resources
http://robotframework.org/#test-libraries
Https://github.com/robotframework/Selenium2Library
Https://github.com/piaoransk/robotframework-appiumlibrary
Http://www.cnblogs.com/fnng/p/4552438.html
Http://blog.sina.com.cn/s/articlelist_1760715297_9_1.html

I. Appium+robotframework+jenkins Environment installation

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.