appium ios real machine automation environment to build & run (source sent)

appium ios real machine automation environment to build & run (source sent)

Appium set up a test environment is relatively cumbersome, many beginners here gone through a lot of detours

The first is the familiar Mac's usage: Linux is a command-line style, the interface is similar to Windows style.

(1) Install the JDK, and configure the environment variables, as follows:

sudo vi / etc / profile in the last line by adding the following:

 

JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/"

 CLASS_PATH="$JAVA_HOME/lib"

 PATH=".:$PATH:$JAVA_HOME/bin"

Save and exit, it does take effect, enter the command Source ~ / .bash_profile

Enter the command java -version, after successful installation environment displayed as follows: 

(2) installed Xcode, Xcode commandline tools and iOS simulator.

Xcode.dmg download and install the App Store. Note that 0 corresponds to the Mac OS X version. Because App source code is developed in Xcode development environment, so we need to debug the source code to run successfully in Xcode in and start to be tested App, the source of import and debugging can find iOS developer responsible for help to get the simulator installed as 3.1 shown in FIG.

 

Figure 3.1

(3) Installation Homebrew:

curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local--strip  1

brew -v displayed as follows:

 

(4) Installation indeviceinstaller:

brew install  indeviceinstaller

ideviceinstaller -h displayed as follows:

 

(5) Installation Appium server Node.js:

brew install node

node -v displayed as follows:

 

(6) Installation Appium client.

Double-click the installation package appium.dmg, or drag it to complete the installation Applications folder. Appium environment variable settings, and configure the path appium.js appium-doctor.js PATH environment variable to a file reference, shown in Figure 3.2.

 

Figure 3.2

Open Appium client, shown in Figure 3.3.

 

Figure 3.3 

(7) Installation npm wd:

 npm install wd

(8) mounted SourceTree, Git or SVN, then taken App developed source code:

 clonessh://[email protected]:30020/mnt/repo/app

 git Username Password: zouhui / 3ihU88uy *** take source code version management, enter a user name and password

 ssh: //[email protected]: 30020 / mnt / repo / ev ** _ App source path taken versioning

(9) application developers to debug certificate.

Because Apple Developer Certificate should be charged, so it is necessary to develop a team official iOS application for automated testing and debugging source code rights need to be developed in the back-end platform tools, it may apply to the company's head of iOS development to provide mobile UDID : 3c22f4c14660eda7d3051636ae659b6b998af8db;

IOS developers will then be responsible for providing: App source code, debug certificate of iOS, open mobile UDID debugging permissions.

IOS developers make recommendations directly responsible for installing the commissioning certificate, because the certificate installation is too much trouble, and sometimes it is easy to make mistakes, so please install the developer can be resolved quickly.

Alternatively, you can run in the simulator, but the real test process is generally run on a real machine.

(10) is mounted Eclipse

(11) installed Ant, and set the environment variable:

 sudo

 chmod +w /etc/bashrc

 export ANT_HOME=/usr/local/apache-ant-1.9.3

 export PATH=${PATH}:${ANT_HOME}/bin

(12)Appium客户端界面的配置

真机测试时需要设置以下4个必填项:

  1)BundleID:待测试App的package名称, 如com.test.buy。

  2)Force Device:iPhone手机设备, 如iPhone 6。

  3)Platform Version:iOS版本号, 如9.3。

  4)UDID:手机设备唯一ID,如3c22f4c14660eda7d3051636ae659b6b998af7dc。

如图3.4所示。

▲图3.4

Appium中Xcode默认Path设置如图3.5所示。

▲图3-.5

Appium中的环境配置检查Doctor,打勾表示正常,如图3.6所示。

▲图3.6

Appium中的Inspector工具,可以帮助我们快速定位元素,通常也是通过name和XPath等方式。

Appium中,Launch用来启动停止操作,启动成功时如图3.8所示。

▲图3.8

单击图标,弹出Inspector,进行控件元素的获取,查找元素的XPath、name等,如图3.9所示。

 

▲图3.9

 

3.3 iOS自动化测试运行

(1)   iPhone手机开启运行自动化 ,单击设置—>开发者—>EnableUI Automation —>yes。

将手机连接到电脑上,并且使Xcode能识别到该手机。 

(2)   单击Launch按钮,启动 Appium,无错误日志。

(3)   在Eclipse中运行已经写好的测试代码(详细请看第4章),可看到在Appium客户端中有自动化数据和日志详细信息输出,手机上可以看到看到App自动化测试用例已开始在运行。

(4)   查看测试结果。

3.4 iOS的App自动化测试demo演示视频

    登录账号:[email protected]

    登录密码:*******

http://www.iqiyi.com/w_19rsoh2gip.html#vfrm=2-3-0-1

http://v.youku.com/v_show/id_XMTY2MzU4OTk5Ng==.html  

 

App 自动化测试框架 demo 源码链接:https://pan.baidu.com/s/1bEwMh4 密码:g7pk 

Guess you like

Origin www.cnblogs.com/finer/p/11330630.html