问题
I've been trying to implement UI test script for my iOS application. In test cases I come over an issue of setting user's preference in setting. So far I could not find a way to change or read these user preference values.
These are what I have learn so far:
- setPreferencesValueForKey and preferencesValueForKey doesn't work by using identifier in Root.plist as a search key. It will return null. However, I can add these value via UIA script and the simulator seems to remember them but the application it self doesn't notice these changes.
- Tried set value for both ON and OFF in Setting.bundle, doesn't help.
My environment:
- I am using version 4.3.2 Xcode which instrument embedded in it.
- Mac OS X 10.7.3
- iPhone 5.1 simulator
Any thoughts?, thank you in advance for all advises, comments and solutions =)
回答1:
Approach describe only works if running on iOS device where it won't work on iOS simulator. So I just use the actual device to run the test script! And that is my solution!
来源:https://stackoverflow.com/questions/10853180/accessing-ios-user-preference-through-uia-script-for-ui-automation