Playing with the repository

Ask general questions here.
User avatar
giuseppe.lacagnina
Posts: 113
Joined: Fri Sep 18, 2015 10:25 am
Location: Brunn am Gebirge, Vienna, Austria

Playing with the repository

Post by giuseppe.lacagnina » Thu Sep 01, 2016 1:49 pm

Hi.

I have tried to hack the repository file to duplicate items. The thing I could not give a value, of course, was the ID. The hacked repository has worked. After all, it is essentially an XML file.

Question: is it possible to proceed like that, without this ID attribute? Or can something go wrong?

A colleague has asked me whether she can use this trick to add many items to the repository
without having to add them one by one.

Unfortunately, we cannot for the time being update to Ranorex 6.0 and we have to use version 5.4.4.

Thanks!!!

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

Re: Playing with the repository

Post by krstcs » Thu Sep 01, 2016 2:29 pm

The ID is a GUID string, and every element in the repository MUST have one, and it MUST be unique within the test suite. Ranorex uses these behind-the-scenes to associate elements.

While it is technically possible to directly add elements to the repository (rxrep) file, it is highly discouraged, mainly because of this GUID issue. Each element must have a unique one, and there may be several other places that use this same GUID that you may not be aware of. This can cause significant issues with your test suite and be very hard to fix.

I would strongly recommend not manipulating the repository manually, except in the event that you have an issue that you are trying to fix (like merge conflict resolution).
Shortcuts usually aren't...

User avatar
giuseppe.lacagnina
Posts: 113
Joined: Fri Sep 18, 2015 10:25 am
Location: Brunn am Gebirge, Vienna, Austria

Re: Playing with the repository

Post by giuseppe.lacagnina » Thu Sep 01, 2016 2:47 pm

Thanks! I suspected something like that.

How would you add a lot of items, then, without going through the process of adding them one by one in the Studio?

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

Re: Playing with the repository

Post by krstcs » Thu Sep 01, 2016 2:57 pm

One thing you can do is to open Ranorex Spy and track an object on the SUT. Then, you can right-click the top-level object and select "Add to repository (incl. Children)". Be careful though, as this will add ALL of the child elements to the repository, which can take a while if there are a lot.

The issue with doing this is that now you may have to go through each one and validate that it is correct for what you need. Ranorex's algorithm is pretty good, but not perfect, and it doesn't know what you actually want. So, in the end this may be no better than just adding the items individually and setting the paths the way you want them the first time through (this is what I do).

Once you get really familiar with how the RXPath and repo works, I find that adding things individually and manually adjusting the paths is faster. But I also only add elements when I need them. So I wouldn't add something unless I was creating the module that it would be used in.
Shortcuts usually aren't...

User avatar
giuseppe.lacagnina
Posts: 113
Joined: Fri Sep 18, 2015 10:25 am
Location: Brunn am Gebirge, Vienna, Austria

Re: Playing with the repository

Post by giuseppe.lacagnina » Thu Sep 01, 2016 4:28 pm

Makes perfect sense!
Thanks a lot to everyone!