XCUITest - fail to find UICollectionView Cell and cell items

徘徊边缘 提交于 2020-03-04 21:33:16

问题


i have collection list of items cell , i wants to make UI test (XCUItest). But unable to find the element collection view cell and its elements inside it .

UIViewController

 ---> UICollectionView
   ----> UICollectionViewCell
     -----> The element that I would like to get.

func testProductListingPageLoad() {
      let collection = app.collectionViews["ProductList"]
      let element = collection.cells["ProductListItemCell0"].firstMatch
      XCTAssert(collection.exists) // it is successful
      XCTAssert(element.exists) // Fails at this line   
}

来源:https://stackoverflow.com/questions/60361289/xcuitest-fail-to-find-uicollectionview-cell-and-cell-items

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