iOS-Testing: How to scroll an UICollectionView?

Mobile Testing, Android App Testing.
Patrick Hollerbach
Posts: 21
Joined: Thu Jan 02, 2014 4:00 pm

iOS-Testing: How to scroll an UICollectionView?

Post by Patrick Hollerbach » Mon Jul 14, 2014 10:06 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Fri Jul 18, 2014 1:40 pm

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
UICollectionView.png (6.41 KiB) Viewed 2745 times
Regards,
Markus
.
Image

Patrick Hollerbach
Posts: 21
Joined: Thu Jan 02, 2014 4:00 pm

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

Post by Patrick Hollerbach » Fri Jul 25, 2014 2:54 pm

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

Patrick Hollerbach
Posts: 21
Joined: Thu Jan 02, 2014 4:00 pm

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

Post by Patrick Hollerbach » Mon Mar 02, 2015 12:55 pm

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Wed Mar 04, 2015 3:07 pm

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)
.
Image