Using references in repository for common UI elements

Ranorex Spy, Recorder, and Studio.
Marc
Posts: 10
Joined: Wed Feb 15, 2017 5:54 pm

Using references in repository for common UI elements

Post by Marc » Mon May 15, 2017 9:48 pm

Hi,
I was curious if it's possible to use references in the element repository.

E.g. I have several different form elements in a UI that all have a scrollbar. My repository looks like:

rootedFolderCommon.rootedFolderFoo.scrollbar.elements
rootedFolderCommon.rootedFolderBar.scrollbar.elements

where elements are line up, pg up, etc.

I would like to be able to define a simple folder named 'scrollbar' not attached to a rooted folder and do something like:
rootedFolderCommon.rootedFolderFoo.ref:scrollbar
So I can define common collections of UI elements and use them in different parts of my repo.

Any thoughts? Or is this a case where I just have to copy-paste all over the place?

-Marc

User avatar
Stub
Posts: 173
Joined: Fri Jul 15, 2016 1:35 pm

Re: Using references in repository for common UI elements

Post by Stub » Tue May 16, 2017 8:42 am

I too have 'common' sets of items that I re-use (ie copy and paste) in many different folders in my Repository. Wouldn't mind being able to create a reference to these common sets of controls too actually.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Using references in repository for common UI elements

Post by krstcs » Tue May 16, 2017 11:52 pm

If you want to make a feature request, please use Ranorex's UserVoice site: http://uservoice.ranorex.com.

As for how to have common repo items, I don't know your UI structure, so I can only give generalities. You can use rooted folders that are generic in their path, and then put the actual elements inside that. For example, if you have the rooted folder "scrollbar", you can just make its path be generic enough to find all of the scrollbars (I would add "@visible='true' and @enabled='true'", to make sure you only find the "top" one), and then put the elements in that rooted folder.
Shortcuts usually aren't...

Marc
Posts: 10
Joined: Wed Feb 15, 2017 5:54 pm

Re: Using references in repository for common UI elements

Post by Marc » Wed May 17, 2017 12:39 am

I tried that, and while it (mostly) worked it imposed quite a long delay as the engine searched the UI tree.
Our workspace is constantly tearing down and bringing up new UI elements, so the ability of the repository to cache the ranoreXpath is constrained.