Page 1 of 1

Ranorex Repository

Posted: Tue Oct 23, 2018 11:38 am
by Ramona
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.

Re: Ranorex Repository

Posted: Wed Oct 24, 2018 10:15 am
by odklizec
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.

Re: Ranorex Repository

Posted: Wed Oct 24, 2018 11:22 am
by Ramona
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!

Re: Ranorex Repository

Posted: Wed Oct 24, 2018 11:36 am
by odklizec
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?

Re: Ranorex Repository

Posted: Fri Oct 26, 2018 12:57 pm
by Andymann
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.

Re: Ranorex Repository

Posted: Mon Oct 29, 2018 7:45 am
by Ramona
Thank you very much for all your responses. I found a solution which seems with Andymann's solution.

Best regards!