title: Xcode 7 ui automation - loop through a tableview/collectionview
body: <p>I am using xCode 7.1. I would like to automate interaction with all cells from a table/collection view. I would expect it to be something like this:</p>
  
  <pre><code>for i in 0..&lt;tableView.cells.count {  
      let cell = collectionView.cells.elementBoundByIndex(i)  
      cell.tap()  
      backBtn.tap()  
  }
  </code></pre>
  
  <p>However this snippet only queries current descendants of the table view, so it will loop through the first m (m &lt; n) loaded cells out of total n cells from the data source.</p>
  
  <p>What is the best way to loop through all cells available in data source? Obviously querying for .Cell descendants is not the right approach.</p>
  
  <p>P.S.: I tried to perform swipe on table view after every tap on cell. However it swipes to far away (scrollByOffset is not available). And again, don't know how to extract total number of cells from data source.</p>
  
  <p>Cheers,
  Leonid</p>