Page 1 of 1

Pass variable to Repository hosted in separate project

Posted: Wed Mar 28, 2018 4:07 pm
by matthewk
I have a Ranorex setup running on our CI and working no problems.

We test multiple environments so my Repository takes in a $RootDomain variable depending on which environment is being tested. All working fine when everything was contained in one project in the solution.

I am now looking at restructuring the whole setup to make it more reusable for multiple projects going forward.

I have moved the Repository out in to its own separate project and reference it from other projects in the solution - this is working for the majority of use cases.

The one issue I have is the Repository items which were using the $RootDomain variable. Now it is in a separate project I don't seem to be able to provide this value to the Repository from my other projects in the solution. Does anyone know how this can be achieved?

Re: Pass variable to Repository hosted in separate project

Posted: Wed Mar 28, 2018 4:27 pm
by krstcs
My recommendation is that you keep your test modules and the repository ALL in the same project. This will ensure that your modules have direct access to the repo without doing any crazy gymnastics to try and get it all to work. Make that project your library or core, and all the other projects are just test suites that use the modules from core.

Mine look like this:

MyTest
--MyTest_Core
----MyModules
----MyRepo
--MyTest_1
----MyTest_1.rxtst
--MyTest_2
----MyTest_2.rxtst
...

Your test suites will just reference MyTest_Core, and you can still just drag-and-drop the test modules from core into the suites in any of your other projects and Ranorex will automatically add the reference for you.

The suites will have their own repo and modules that can be used for suite-specific stuff, if needed, but I rarely do that.

For me, doing it this way is much easier to manage.

This also means that if you have multiple people working on the solution, they can each take a separate project and do their own tests without really impacting anyone else with merges and such. The only issue is that they may all need to merge new modules and repo items into core. I recommend that this be done in a separate branch and each branch be merged back into master as needed with peer-review of merges and conflict resolutions.

Hope this helps!

Re: Pass variable to Repository hosted in separate project

Posted: Mon Apr 16, 2018 5:01 pm
by matthewk
Only just seen this - thanks.

I will take a look at implementing as you suggest and see how I get on