简体   繁体   English

XCTestCase:使用IndexPath点击collectionView中的单元格

[英]XCTestCase: Tap on cell in collectionView with IndexPath

I have a collection view in my UI test and I would like to tap on cell with IndexPath 1-0. 我在UI测试中有一个集合视图,我想用IndexPath 1-0点击单元格。 How can this cell be addressed in an UI test? 如何在UI测试中解决此单元?

I found this, but it is not what I want: app.collectionViews.cells.elementAtIndex(1).tap() 我找到了这个,但它不是我想要的: app.collectionViews.cells.elementAtIndex(1).tap()

elementAtIndex is now deprecated. elementAtIndex现已弃用。 You have to use elementBoundByIndex instead 你必须使用elementBoundByIndex

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM