Directory:
I. BACKGROUND
Ii. introduction of Fastmonkey
Iii. Fastmonkey Preparation before operation
Four, Fastmonkey engineering configuration process
V. Implementation of MONKEY Test
Vi. FAQs
Fastmonkey Practice
First, background:
For a well-known reason, with Xcode upgrading from 7.x to 8.x or 9.x, we are no longer able to monkey iOS apps with instrument's uiautomation script, so we've been looking for industry testing and development Daniel to produce new monkey open source tools , during which we also used a number of technical gods developed by Appium-based or Macaca-based open source monkey testing tools But there are such or that the problem such as: Configuration is too copy, slow to use, the implementation speed is not up to the requirements, and some also need to do the application of the source plug village and other issues, It was not until the advent of faskmonkey that it integrates the length of the home and has basically been able to meet our daily stress tests for iOS applications.
Second, Fastmonkey Introduction:
Fastmonkey is a recent open source iOS App Monkey Test tool for Zhangzhao, based on Xctestwd,swiftmonkey two development, enabling iOS Monkey automation tools Fastmonkey without piles, with the following benefits:
1. No need to insert piles! 2. High efficiency, 4-5 action! per second 4. Light weight minimalist! For more information, please refer to the Testerhome link:
Faskmonkey Test Tool Introduction
Project Open Source Address:
xcode9.x (Https://github.com/zhangzhao4444/Fastmonkey)
xcode8.3.x (https://github.com/zhangzhao4444/Fastmonkey/tree/xcode8.3)
Three, Fastmonkey before operation preparation:
Note: The procedure described in this article is based on the xcode8.x or xcode9.x version, note that for non-xcode versions download different project engineering, pre-operation preparation:
1) xcode8.3.x/xcode9.x software;
2) IOS third-party Library management tool-Carthage;
3) iOS developer certificate file;
4) Fastmonkey Engineering code downloaded from GitHub;
Detailed Description:
1) xcode8.3/xcode9.x is used for importing Faskmonkey engineering and running monkey test;
2) Carthage is the third-party library that iOS uses to download the project; if it is not installed, install it using the following command:
Brew Install Carthage
3) iOS developer certificate used in the construction and signature of the project, the certificate can be a team developer certificate can also be a free personal developer certificate, how to apply for a personal developer certificate please refer to other documents here no longer allocations.
4) Engineering code download directly from Https://github.com/zhangzhao4444/Fastmonkey
Four, Fastmonkey engineering configuration process
The configuration was verified by us, but because each person's phone and xcode version of the problem may be some differences, you can also refer to testerhome on the Fastmonkey self-literacy stickers
Fastmonkey's Literacy posts
1. Unzip the downloaded Fastmonkey-xxx.zip file, open the terminal into the extracted sub-directory Xctestwd-master into the extracted sub-directory Xctestwd-master
2. Perform the following steps to download the packages on which the project depends:
1) Modify the Cartfile file in the directory to change GitHub "Swiftyjson/swiftyjson" to GitHub "swiftyjson/swiftyjson" = = 3.1.4 Modify GitHub "Tadija/aexml" to GitHub "tadija/aexml" = = 4.1.0 such as:
Modify the Cartfile file in the directory
2) Download the package that the project relies on
$ Carthage Update
PS: If there is an error in this step, please refer to the following FAQ
Downloading the packages that the project relies on may take some time to depend on your network speed, please be patient and wait for the completion
3. Configuration XCTESTWD Project Project:
Double-click the Xctestwd.xcodeproj file in the subdirectory XCTESTWD to open the project project
1) Modify the product ID, the team developer certificate needs to be modified, the personal free developer certificate can skip this step
A. The product ID required to modify XCTESTWD such as Com.xxxx.XCTestWD.XCTestWD
XXX The product ID prefix defined for the certificate is usually the domain name of the company or enterprise
B. The product ID required to modify the xctestwduitests such as Com.xxx.XCTestWD.XCTestWD
XXX The product ID prefix defined for the certificate is usually the domain name of the company or enterprise
2) Modify the signed account (Personal development team and team Certificate settings are not the same):
A1. Team Developer certificates such as:
A1. Modify XCTESTWD code signing to the corresponding account A1. Modify the XCTESTWD code signing to the corresponding team account
A2. The same A1 process modifies xctestwduitests's code signing account
B. Personal developer certificates such as:
B1. Modifying Xctestwduitests's Code signing account
B2. Modify XCTESTWD's code signing account with B1
3) Add Xctestwdmonkey.swfit to server directory
Right click on the server directory and select "Add Files to" XCTESTWD "
Select the "Xctestwdmonkey.swift" file to add to the server
4) Empty the value of the XCTESTWD objective-c bridging header option
Emptying the value in the Objective-c bridging header option clears the Objective-c bridging header Option 4. Modify the configuration values in the XCTESTWD Project Project code:
1) Modify the run mode to set the Servermode in the Xctestwdrunner.swift file to False as
Modify this to false so that the monkey can run directly from Xcode without the need for additional commands
2) Modify the Bundleid in the Xctestwdmonkey.swift file as the value of the app under test as:
Instead of the actual bundleid of your app, how to find the Bundleid of the app you are testing please Baidu here no longer allocations
2) Modify the ElapsedTime value in the Monkey.swift file to determine how long you need to run the monkey, noting that the unit is seconds, such as:
Modify Monkey execution duration Five, perform monkey test
1) Select the phone to be executed with the target note app installed on the tested phone, the phone has been plugged into the MAC computer USB interface
Select Xctestwduitests and phone from the drop-down list
2) Start execution of Monkey
Select "Product"--"test" to perform monkey test six, FAQ:
1. If you report this error when Carthage update xcrun:error:unable to find utility "Xcodebuild", the Not a developer tool or in path needs to be in Xcode P References > Locations set command line tools for your own version of Xcode-Thank you for the Glow _9c54 reminder
2. If the xcode9.x may appear XCTestWDApplication.h file not found error, follow these methods:
XCTestWDApplication.h File not found error
Add XCTestWDApplication.h and xctestwdapplication.m files to the Privateheaders directory, as
Select Privateheaders and then right-click on the popup screen to select "Add Files to" XCTESTWD "..." Project select XCTestWDApplication.h and XCTESTWDAPPLICATION.M and click Add XCTestWDApplication.h and XCTESTWDAPPLICATION.M were added to the privateheaders
2. The first execution may be error, because the need to trust your personal certificate or team certificate on the phone, the second execution will not. Generally located in the phone "settings"--"general"--"profile"
3. After each run completes, in the Xcode debug ouput box will output the corresponding log and saves the location, each time completes the log to error, this error is due to the Fastmonkey bug, participates in the following issue link, the main reason is when the execution time grows one to, Monkey test self-stop, this stop is strong retreat, but xctest no normal exit caused, there is no good solution.
Https://github.com/zhangzhao4444/Fastmonkey/issues/12
iOS test-fastmonkey