Mac appium ios automated testing under (a)

Under mac ios automated testing, you can use appium, can be directly used facebook-wda library.

Cipian introduce appium:

BundleId first to know before the start of the test app, which is unique to ios. The following command can be used:

ideviceinstaller -l

Encounter problems:

Could not connect to lockdownd. Exiting.

Solution:

Open a command line enter the following code:

brew uninstall ideviceinstaller -g
brew uninstall libimobiledevice -g
brew install --HEAD libimobiledevice -g
brew install ideviceinstaller -g
sudo chmod -R 777 /var/db/lockdown

problem solved.

If there are problems   

brew install --HEAD ios-webkit-debug-proxy -g

brew install ios-webkit-debug-proxy -g

Of course, if the above still does not solve your problem then the following can certainly solve:

brew uninstall -f libimobiledevice ideviceinstaller usbmuxd
brew install -v --HEAD --fresh --build-from-source usbmuxd libimobiledevice ideviceinstaller

 

Step 1: Open end server

The previous presentations, I installed the command line version, using the command line to start:

/usr/local/bin/appium -a 127.0.0.1 -p 4723 -bp 4724

Step 2: Run the test script

Following examples:

#! /usr/bin/env python
#coding=utf-8

import time,os
from appium import webdriver
from appium.webdriver.common.touch_action import TouchAction


driver = webdriver.Remote(command_executor='http://127.0.0.1:4723/wd/hub',
                               desired_capabilities={
                               'bundleId': 'com.lifesense.LSWearable.iusexxx',
                               'platformName': 'iOS',
                               'platformVersion': '10.3',
                               'deviceName': 'sandyiPhone',
                               "automationName": "XCUITest",
                               "Moresheth ": False,
                               "UDID": "11c7b654ae4c7b1bb43d456c5e5e7fxxxxxxxx" 
                               }) 

the time.sleep (. 5) 
driver.find_element_by_name ( "Enter a phone number") .send_keys ( "13,148,536,426") 
driver.tap ([(30,95), [30,98]] , 500) 
driver.find_element_by_accessibility_id ( "account password") .click () 
# el2.click () 
EL3 = driver.find_element_by_xpath ( 
    "// XCUIElementTypeApplication [XCUIElementTypeSecureTextField") 
el3.send_keys ( "123456") 
driver.tap ([ (30,95), [30,98]], 500) 
EL4 = driver.find_element_by_accessibility_id ( "Login") 
el4.click ()

 Please refer to the use of positioning elements inspector articles

Guess you like

Origin www.cnblogs.com/Sandy-1128/p/sandy1128-mac-appiumiostest.html