Page 1 of 1

iOS-Testing: How to scroll an UICollectionView?

Posted: Mon Jul 14, 2014 10:06 am
by Patrick Hollerbach
Hello all,

in our AUT we have an UICollectionView, which contains some sections with items, the user can scroll the UICollectionView. How can I scroll the UICollectionView with ranorex to reach the items which are on the bottom of the UICollectionView? An iOSTable provides a ScrollTable() method, but I can't find anything like this for the UICollectionView.
We're still using Ranorex 4.1.6 because of a bug in Ranorex 5 which causes our AUT to crash (which will be hopefully fixed in 5.1.1). Is there any way to scroll the UICollectionView with Ranorex 4.1.6 or will it be possible with 5.x?

Thanks,
Patrick

Re: iOS-Testing: How to scroll an UICollectionView?

Posted: Fri Jul 18, 2014 1:40 pm
by Support Team
Hi Patrick,

The UICollectionView control is supported since Ranorex 5.0 and is identified as a Ranorex Table.
In order to scroll a UICollectionView you can use the Set Value action and the ContentOffsetY attribute as shown below:
UICollectionView.png
Regards,
Markus

Re: iOS-Testing: How to scroll an UICollectionView?

Posted: Fri Jul 25, 2014 2:54 pm
by Patrick Hollerbach
Hi Markus,

works for me with ContentOffsetX. I use the height of the UICollectionView to scroll exactly "1 Page". Thank you very much!

Regards,
Patrick

Re: iOS-Testing: How to scroll an UICollectionView?

Posted: Mon Mar 02, 2015 12:55 pm
by Patrick Hollerbach
Hi there,

we migrated to Ranorex 5 which identifies a UICollectionView as a Ranorex Table.
But there is no method in a Ranorex Table to scroll the table.
Ranorex iOSTable has a method "ScrollTable" but it is not possible to cast a Ranorex Table which is a UICollectionView to an iOSTable.

Can you tell me how I can scroll the UICollectionView?

Regards,
Patrick

Re: iOS-Testing: How to scroll an UICollectionView?

Posted: Wed Mar 04, 2015 3:07 pm
by Support Team
Hi Patrick,

You can either use a Swipe gesture or an invoke action ‘EnsureVisible()’ on the specific element in order to scroll within your UICollectionView.

Regards,
Markus (S)