我的工作我的第一個UI自動化腳本,我在下面的deactivateAppForDuration線遭遇了失敗:的iOS UI自動化deactivateAppForDuration失敗
// Verify password field is shown when app is moved to the foreground
UIALogger.logMessage("move app to background");
target.deactivateAppForDuration(10);
UIALogger.logMessage("move app to foreground");
我從儀器得到的錯誤是:
Script threw an uncaught JavaScript error: Cannot perform action on invalid element: UIAElementNil from target.frontMostApp().switcherScrollView().buttons()["TimeClock"]
我在測試設備上看到的應用程序已切換到背景並顯示iOS應用程序切換器。我可以看到我的應用程序(TimeClock)。它從錯誤消息和設備屏幕中顯示,UI自動化無法選擇我的應用程序以轉換到前臺。
有其他人遇到過這個問題嗎?有沒有解決辦法?
謝謝。
在這種情況下,'switcherScrollView()'表示設備本身的切換控件,而不是應用程序。 'switcherScrollView()。buttons()[「TimeClock」]'表示應用切換器中他的應用的圖標。 – Darc 2012-03-28 22:22:14