久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何使用 UIAutomation 從 UIImagePickerController 中選擇

How to use UIAutomation to select image from UIImagePickerController(如何使用 UIAutomation 從 UIImagePickerController 中選擇圖像)
本文介紹了如何使用 UIAutomation 從 UIImagePickerController 中選擇圖像的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我們正在嘗試圍繞應用程序中的流程進行 UIAutomation 測試,其中用戶從 UIImagePickerController 中選擇圖像.在我們嘗試從選取器控制器中選擇圖像之前,所有的自動化都運行良好.似乎我們無法找到正確的對象來發送水龍頭.這是我們正在嘗試的:

We are trying to get a UIAutomation test around a flow in our app where a user selects an image from a UIImagePickerController. All the automation works great, until we try to select an image from the picker controller. It seems like we cannot get the right object to send the tap to. Here is what we are trying:

 UIALogger.logMessage("Navigation Title: " + app.navigationTitle() );
 window.collectionViews()[0].tapWithOptions({tapOffset:{x:0.5, y:0.5}});

上面將導航標題顯示為時刻",這意味著我們在照片選擇器中,但第二行沒有錯誤 - 但沒有選擇任何東西(無論坐標).

The above will show the navigation title as "Moments", which means we are in the photo picker, but the second line gets no error - but does not select anything (no matter the coordinates).

測試最終失敗,卡在照片選擇屏幕上.

The test ultimately fails being stuck on the photo selection screen.

我記錄了下面的元素樹,您可以看到那里似乎有一個 UICollectionView,但所有單元格都是節標題,并且在調試日志輸出中沒有一個是實際的照片".

I logged the element tree below, and you can see that it appears that there is a UICollectionView out there, but all the cells are the section headers and there are none in the debug log output that are actual 'photos'.

那么我們如何使用 UIAutomation 從 UIImagePickerController 中選擇圖像?

So how do we select an image from a UIImagePickerController with UIAutomation?

謝謝!

推薦答案

所以,我想通了.呃.我只需要訪問可見的單元格并將水龍頭發送到其中一個.像魅力一樣工作.

So, I figured this out. Duh. I just needed to access the visible cells and send the tap to one of those. Works like a charm.

window.collectionViews()[0].visibleCells()[0].tap();

我希望這對其他人有幫助!

I hope this helps someone else!

這篇關于如何使用 UIAutomation 從 UIImagePickerController 中選擇圖像的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Using Instruments to test an iOS app without having source code to the application(在沒有應用程序源代碼的情況下使用 Instruments 測試 iOS 應用程序)
KIF: How to auto-run/stress test an iOS app to find the cause of a rare UI bug?(KIF:如何自動運行/壓力測試 iOS 應用程序以找出罕見 UI 錯誤的原因?)
Can#39;t change target membership visibility in Xcode 4.5(無法更改 Xcode 4.5 中的目標成員身份可見性)
UITableView: Handle cell selection in a mixed cell table view static and dynamic cells(UITableView:在混合單元格表視圖靜態和動態單元格中處理單元格選擇)
How to remove Address Bar in Safari in iOS?(如何在 iOS 中刪除 Safari 中的地址欄?)
iOS 5 SDK is gone after upgrade to Xcode 4.5(升級到 Xcode 4.5 后,iOS 5 SDK 消失了)
主站蜘蛛池模板: 国产成在线观看免费视频 | 中文字幕一区二区三区乱码在线 | 久久精品中文字幕 | 日日想夜夜操 | 青青久在线视频 | 天天综合日日夜夜 | 亚洲 欧美 另类 综合 偷拍 | 久久精品免费 | 日韩视频精品在线 | 成人无遮挡毛片免费看 | 欧美二区在线 | 日本二区在线观看 | 亚洲高清视频一区二区 | 黄色日本片 | 成人综合一区二区 | 中文字幕二区 | 欧美精品首页 | 亚洲91精品 | 欧美精品在线播放 | 亚洲精品2| 久久综合久色欧美综合狠狠 | 久久精品国产久精国产 | 免费能直接在线观看黄的视频 | 免费黄色片在线观看 | 在线观看欧美日韩视频 | 国产 日韩 欧美 在线 | 日韩精品一区二区三区视频播放 | 中文字幕在线免费观看 | 国产精品日韩欧美一区二区 | 麻豆一区| 色婷婷综合在线观看 | 波多野结衣中文视频 | 日韩在线| 日本在线网址 | 中文字幕av网站 | 久久99国产精品久久99果冻传媒 | 亚洲人成人一区二区在线观看 | 国产高清一区二区 | 久久精品99久久 | 青青久草 | 黄色在线观看网址 |