Accessing iOS user preference through UIA script for UI automation

拈花ヽ惹草 提交于 2019-12-07 19:03:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!