IOS App自动化测试环境配置 - Selenium2.0+Appium

(注:项目是HP的,客户在美国,配置文档是给客户看的,所以用的E文,也懒得翻译了,见谅)
Test Environment
Mac and IOS environment
Mac mini: OS X 10.10.3
IOS devices: iPhone 5S 8.0

Software environment
JDK 1.8.25
XCode 6.3
Appium 1.3.7
HP ePrint IOS App 5.7.0.181

Apple developer accountrequirement
IOS Develop Permission. $99 per year.

Xcode Account Setup
Create a developer account onApple web site, and then login Xcode with the account.
Xcode -> Preferences -> Accounts -> Click ‘+’ toadd a new account -> Add the developer account.
IOS App自动化测试环境配置 - Selenium2.0+Appium_第1张图片

Apple Developer Certificates
IOS App自动化测试环境配置 - Selenium2.0+Appium_第2张图片
IOS App自动化测试环境配置 - Selenium2.0+Appium_第3张图片

Download the certificates and save it into local disk. It’scertSigningRequest type file.

Create App ID.
Input any string in App ID Description failed, select “WildcardApp ID”, input “com.hp.*” in bund ID field, and then click Continue save it.
The App ID means a project name, so the created App IDshould matches the tested iOS app bundle ID, but we cannot create the explicitApp ID, such as ePrint “com.hp.com.HPePrintHome-n-Biz”, So we need create awildcard App ID, such as “com.hp.*”, it means the App ID works for all the iOSapp which bundle ID’s prefix is “com.hp.”.
IOS App自动化测试环境配置 - Selenium2.0+Appium_第4张图片

iOS device Setup
Select device tab and click “+” button, create device Nameand input the UUID and save it.
Get UUID from Xcode, open Xcode -> Window -> Devices-> select the connected device via USB, the Identifier is the UUID.
IOS App自动化测试环境配置 - Selenium2.0+Appium_第5张图片

Generate ProvisioningProfiles.
Click “+” button to open “Add iOS Provisioning Profile”page. Select “iOS App development”and click “Continue”.
IOS App自动化测试环境配置 - Selenium2.0+Appium_第6张图片

Select the created App ID just now and click “Continue”.
IOS App自动化测试环境配置 - Selenium2.0+Appium_第7张图片

Select the created certificates just now and click “Continue”.
IOS App自动化测试环境配置 - Selenium2.0+Appium_第8张图片

Select the new registered iOS device and click “Continue”
IOS App自动化测试环境配置 - Selenium2.0+Appium_第9张图片

Create a profile name and click “Generate” button.
IOS App自动化测试环境配置 - Selenium2.0+Appium_第10张图片

Download the provisioning profile and save it into localdisk.
IOS App自动化测试环境配置 - Selenium2.0+Appium_第11张图片

Re-sign IOS App
1) First extract HPePrint.app fromHPePrint.ipa
2) Generate “entitlements.plist”file and put it into the app folder.
The file contents should be, and open the file correct with Xcode.



<plistversion="1.0">
<dict>
  <key>get-task-allowkey>
  <true/>
dict>
plist>

IOS App自动化测试环境配置 - Selenium2.0+Appium_第12张图片

3) Use the below command to re-sign the app.
Open a terminal and go to the app folder, execute below command.

codesign -f -s "iPhone Developer: XXXX" ./HPePrint.app/ResourceRules.plist HPePrint.app --entitlements entitlements.plist

IOS App自动化测试环境配置 - Selenium2.0+Appium_第13张图片
The parameter “iPhone Developer: XXXX” can be found inKeychain Access.
IOS App自动化测试环境配置 - Selenium2.0+Appium_第14张图片

Appium and iOS Device Setup.
1) iOS setup
iOS device –> settings -> Developer -> Turn on “EnableUI Automation” option
IOS App自动化测试环境配置 - Selenium2.0+Appium_第15张图片
2) Install provisioning profileand re-signed app into iOS device.
Open Xcode -> Window -> devices -> click settingbutton below and open “Show Provisioning Profiles”
IOS App自动化测试环境配置 - Selenium2.0+Appium_第16张图片
Click “+” to add the provisioning profile into the iOSdevice.
IOS App自动化测试环境配置 - Selenium2.0+Appium_第17张图片
Return device window and click “+” to select the re-signedapp and install it into device.
IOS App自动化测试环境配置 - Selenium2.0+Appium_第18张图片
3) Appium setup
IOS App自动化测试环境配置 - Selenium2.0+Appium_第19张图片
The parameter BundleID can be found in Xcode.
IOS App自动化测试环境配置 - Selenium2.0+Appium_第20张图片

Launch Appium Inspector
Open Appium -> click Start -> click Appium Inspector
Environment was ready if the Appium inspector launchedsuccessfully in Mac and the App launched successfully in iOS device.
IOS App自动化测试环境配置 - Selenium2.0+Appium_第21张图片


你可能感兴趣的:(自动化测试,Selenium,IOS,ios,自动化测试)