Ranorex Repository

Ranorex Spy, Recorder, and Studio.
Ramona
Posts: 3
Joined: Tue Oct 23, 2018 11:32 am

Ranorex Repository

Post by Ramona » Tue Oct 23, 2018 11:38 am

Hello,

Is there a way to write my own repository without a record and make a dynamic mapping of a interface?
I wanna work without recordings only with files "UserCodeModulex.cs" and I need to write my own repository.

Thank you.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex Repository

Post by odklizec » Wed Oct 24, 2018 10:15 am

Hi,

The only other way, how to create repository items (besides Recording), is using Track feature from Repository view/Ranorex Spy or add the repo elements manually.

May I ask you why do you want to use only codemodules? What do you see as a downside, while using Recordings? From my point of view, using recordings makes the development much faster? I only rarely use recording facility in these days, but I still use Recording modules (simply drag&drop repo elements to recording modules). Recording modules are easier to create and maintain and definitely easier to read and understand for Ranorex newcomers. Plus each recorded/manually added Ranorex action automatically adds a report log! And of course, Ranorex automatically produces valid C# code for each action, so there is no chance for coding mistakes. So all in all, I don't see any real disadvantage of using recordings? I'm using codemodules only when it's easier to do something from code.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Ramona
Posts: 3
Joined: Tue Oct 23, 2018 11:32 am

Re: Ranorex Repository

Post by Ramona » Wed Oct 24, 2018 11:22 am

I have a xml file(contains informations about my tests) and I want to use it in a script to navigate on my app and get reports. This script will generate automatically the files for Ranorex based on xml file. I want to use just RUN from Ranorex to get reports.

Thank you for your answer!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex Repository

Post by odklizec » Wed Oct 24, 2018 11:36 am

Hi,

Even without seeing your xml, I seriously doubt there is a way to achieve what you want. There is definitely no way to automatically create repo elements and then use them for your code modules. I just don't see a way to do this all by just one xml file, describing your test?

You see, there are multiple problems...
At first, to be able to create a repo element, the GUI must be in state that the element in question is available. Who will navigate it to that state? Since there is no script yet, you will have to do this manually. And then you will have to create a new repository item, either by recording the action or tracking the element manually.
At second, you must somehow associate the repo elements with actions. How do you expect Ranorex would do that?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
Andymann
Posts: 41
Joined: Wed Jul 27, 2016 12:22 pm
Location: Hamburg
Contact:

Re: Ranorex Repository

Post by Andymann » Fri Oct 26, 2018 12:57 pm

You could, however, dynamically create instances of RxPath in UserCode and use those:

Code: Select all

Ranorex.Unknown thing = null;
String  sTmp += "//a[@" + pAttribute + "='" + sVal + "']";	//----Your code here
Host.Local.TryFindSingle<Ranorex.Unknown>(new RxPath(sTmp), 12500, out thing);
But there are probably two or three approaches that prove to be more sensible in the long run.
Vorsprung durch Wahnsinn
www.Doktor-Andy.de

Ramona
Posts: 3
Joined: Tue Oct 23, 2018 11:32 am

Re: Ranorex Repository

Post by Ramona » Mon Oct 29, 2018 7:45 am

Thank you very much for all your responses. I found a solution which seems with Andymann's solution.

Best regards!