使ç¨iOS模æå¨
1. ä¸è½½ç¤ºä¾åºç¨ç¨åºTestAutomation.xcodeprojï¼å¹¶æå¼å®ãè¿ä¸ªé¡¹ç®æ¯ä¸ä¸ªå¾ç®åçå
å«2个tabçtabbaråºç¨ç¨åºã
2. ç¡®ä¿éä¸å¦ä¸å¾æ示çâTestAutomation > iPhone 5.0 Simulatorâ模å¼ï¼æè®¸ä½ å·²ç»åæ¢æ5.1äºï¼å æ¤å®å¯è½æ¯iPhone5.1模æå¨ï¼ã
3. å¯å¨Instruments(Product > Profile)ï¼æè
éè¿⌘Iã
4. éæ©å·¦è¾¹çiOS Simulatorï¼ç¶ååéæ©Automation模æ¿ï¼ç¶åç¹å»âProfileâã
5. Instruments就已ç»å¯å¨å¥½åï¼ç¶åç´æ¥å¼å§å½å¶äºãè¿éå
åæ¢å½å¶ï¼ï¼çº¢å
æé®æè
⌘Rï¼ã
6. å¨å·¦è¾¹çScriptsçªå£ï¼ç¹å»âAdd > Createâå建æ°çèæ¬ã
7. å¨èæ¬ç¼è¾å¨éï¼è¾å
¥ä¸é¢ç代ç
var target = UIATarget.localTarget();
var app = target.frontMostApp();
var window = app.mainWindow();
target.logElementTree();
8. éæ°è¿è¡è¿æ®µèæ¬⌘Rï¼ä¸éè¦ä¿åï¼ãèæ¬è·èµ·æ¥åï¼ä½ å¯ä»¥å¨æ¥å¿æå®ååæ¢å®ã
èµä¸ä¸ªï¼æ们就è¿æ ·å®æäºæ们ç第ä¸ä¸ªUIAutomationæµè¯ç¨ä¾ã
温馨提示:答案为网友推荐,仅供参考