1. Install node. js
to the official website to download is the installation package , but the nature and installation is using the sudo command , there will be problems , so use the command Brew Install node installation ;
This is based on brewhome , need to install Brewhome first ; this simple , One line Ruby Command ( because the Mac comes with Ruby, it doesn't need extra work ): Ruby-e "$ (Curl- Fssl Https://raw.githubusercontent.com/Homebrew/install/master/install)".
The order is on the website. Home :http://brew.sh/
after installation , You can use the website homepage (https://nodejs.org/) for a small example test : Build a . js file , Copy the code in , and then use node under the execution ; then open the link in your browser and you'll see "Hello World"
2. Installing appium
The official website provides the command : NPM install–g appium. but the middle will be stuck in a Chrome on the link , probably about Google being wall-related . , This link is not available , so use a domestic mirror :
NPM--registry http://registry.cnpmjs.org install-g appium
When the detection environment is ready , use the command : Appium-doctor
3. in the real machine operation also need to install ideviceinstaller, used to control the app on the computer on the loading and unloading of the open, etc. . same Use Brew installation :
Brew Install Ideviceinstaller
4. finally , test scripts that use the python language .
to install python -related modules : selenium,appium-python-client.
You can install by using the pip command :
Pip Install Selenium
Pip Install Appium-python-client
only two lines of command are required in the terminal :
Appium & Open Appium
python/users/qiao/desktop/automation_python.py Use python Execute Script
Then all you have to do is write it in the Python script file .
Full script:
from Selenium Import Webdriver
# Returns ABS Path relative to this file and not CWD
PATH = Lambda P:os.path.abspath (
Os.path.join (Os.path.dirname (__file__), p)
)
Desired_caps = {}
Desired_caps
desired_caps[' platformname ']= ' IOS '
desired_caps[' devicename ']= ' IPhone 6 '
desired_caps[' device '] = ' IOS '
desired_caps[' Bundleid '] = ' Cn.mastercom.AutoTestDemo '
desired_caps[' version '= ' 8.1 '
desired_caps[' app-package '] = ' Cn.mastercom.AutoTestDemo '
desired_caps[' udid ']= ' D34e0f5efd81c8a7d3ed9a7c34bd90c629e3fb35 '
Driver = Webdriver. Remote (' Http://localhost:4723/wd/hub ', desired_caps)
el = driver.find_element_by_name ("1")
El.click ()
el = driver.find_element_by_name ("5")
El.click ()
el = driver.find_element_by_name ("9")
El.click ()
el = driver.find_element_by_name ("delete")
El.click ()
el = driver.find_element_by_name ("9")
El.click ()
el = driver.find_element_by_name ("5")
El.click ()
el = driver.find_element_by_name ("+")
El.click ()
el = driver.find_element_by_name ("6")
El.click ()
el = driver.find_element_by_name ("=")
El.click ()
Driver.quit ()
//////////////////////////
The former part is in the configuration environment information, including platform Device ID app logo, etc., can refer to the official website
http://appium.io/slate/en/master/#server-args.md
Detailed explanation of each parameter
The following is the specific operation, this is the test of the real content, later in the study.
Other than that:
Appium in the iOS test is based on Apple's own tools automation, this is not testing the release version, that is, if the certificate is set to publish a certificate can not be tested. If you want to test the release version, do not know what tools to use, there are friends who know can say.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Appium automated testing of iOS, Appium installation