IPhone applicationsAutomationTestCase implementation is the content to be introduced in this article, mainly to implementIPhone applicationsAutomation inTest. The following is a basic study conducted by colleagues. After thatTest, Or yes. More features require time to study.
Setting method:
(1) install xcode and iPhone SDK on Mac, preferably the latest version.
(2) Open/developer/applications/instruments. app, select all for iOS in the template list, and then select the automation template.
(3) connect the iPhone to Mac, select the "choose target" drop-down menu on the main panel of instruments, select the connected iPhone, select the "choose target" option, and select the application to be tested.Program.
(4) Select "choose script…" on the left side of the instruments main panel ..." Drop-down menu and select a compiled JavaScript Command Script (Suffix:. js. If you need to modify it, click the "edit" button next to it)
(5) Click "record" to start automatic testing. The automatic test does not stop automatically after it starts. You need to manually click "stop" to stop it.
Examples of available command scripts:
- Uiatarget. localtarget (). frontmostapp (). mainwindow (). Buttons () [0]. Tap ();
Click the first button on your software interface.
Possible problem 1:
Unable to obtain task,
- The error message "target failed to run: Remote exception encountered: 'failed to get task for PID ### '" appears.
Cause:
Entitlements. plist is missing in the built application.
The solution is to add an entitlement. plist with "can be debugged:
(1) Open the project with xcode, and select the application to be tested from the "groups & Files" list on the left side of the main panel. Resources
(2) Select File, new file ..., Then, select the IOS code signing in the list on the left and select "entitlements". Then, click "Next" and click "finish.
(3) Open entitlements. plist with/developer/applications/utilities/property list editor. app, and select view, property list type, and iPhone entitlements plist.
(4) In the property list editor. in the main panel of the app, select iPhone entitlements, click "ADD child" in the toolbar, add the "can be debugged" option, tick the value, and save the settings.
(5) In xcode, select project, set active SDK, device, and then select project, set active build configuration, and debug.
(6) After completing the above steps, build the application and synchronize it to the iPhone. When you add entitlements. plist, if you cannot build the certificate or synchronize it to the iPhone, it is likely that the certificate and preset file are the cause. Ensure that the certificate and preset file are valid and imported correctly.
Software Version:
- Instruments 2.7 (3017)
- Xcode 3.2.5
Summary: DetailsIPhone applicationsAutomationTestThe implementation of the case is complete. I hope this article will help you!
[Edit recommendations]
- Nslocalizedstring is used in iPhone applications for internationalization
- Asihttprequest, an open-source HTTP packaging project for iPhone applications
- Highlights and solutions for problems in iPhone application development
- Model object archiving for iPhone application development
- IPhone application Address Book Contact development case
- How to obtain the hardware version and system information in iPhone applications