Copying Tests and Modules to new Projects

Ask general questions here.
AccidentReport
Posts: 76
Joined: Tue Dec 04, 2012 2:30 pm

Copying Tests and Modules to new Projects

Post by AccidentReport » Tue May 13, 2014 8:22 am

I have been building tests for my project in one project but since my project overlaps with another they needed some tests for specific tasks that were seperate from my own. I therefore added a new project into my solution and copied the required tests. This resulted in a test suite for the new project with all the modules 'linked' to the ones in the main project.

Is there an easy way to copy the relevant modules from my main project into the new project so that they stand apart from any future changes to my main codebase?

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: Copying Tests and Modules to new Projects

Post by mzperix » Tue May 13, 2014 8:37 am

Hi AccidentReport,

copying the modules could be a bit trikcy, since they are usually linked to the project's repository. These are the steps I would recommend to do, to copy the modules:

1. Add the main project to your solution by right clicking on the solution and Add-> Existing project
2. Just move the proper recording modules from your main project to your new project.
3. Open the copied recording modules.
4. A popup will be shown asking on what to do with the repository. There are 3 options:
- link the repository (not what you want)
- embed the repository into the recording module
- make a copy of the repository in your new project (maybe this is what you want)

I am not sure if you need to open every recording module to make the repository change, I cannot access my Ranorex right now. But this should give you an idea on how to copy the recording modules.

Another method could be that you copy the proper file in the file system from one procejt to another. Just make sure that a recording file consist of 3 or 4 files:
Recording1.rxrec
Recording1.cs
Recording1.UserCode.cs
Recording1.rxrep (this is only if the repository is embedded into the recording module)

And do not forget to copy the repository also with its dependent files also.

Best Regards,
Zoltan

AccidentReport
Posts: 76
Joined: Tue Dec 04, 2012 2:30 pm

Re: Copying Tests and Modules to new Projects

Post by AccidentReport » Tue May 13, 2014 10:40 am

OK. Not the easy solution I hoped for and it took me a couple of hours to rejig it all but it's not seperated. At least I won't be messing up their tests! Thanks

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

Re: Copying Tests and Modules to new Projects

Post by krstcs » Tue May 13, 2014 3:12 pm

One other thing you could do is make a library project for all of the modules and repositories that everyone will use. Move all of the modules and repos into that, then just reference it in all of your actual tests (and anyone else's tests.

This dll would then need to be included (referenced) in all other projects, but it would be easier to manage.
Shortcuts usually aren't...

AccidentReport
Posts: 76
Joined: Tue Dec 04, 2012 2:30 pm

Re: Copying Tests and Modules to new Projects

Post by AccidentReport » Wed May 14, 2014 10:59 am

The one subset of tests is separate for a reason. They won't really be using the same modules. All other tests are within the main project.

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

Re: Copying Tests and Modules to new Projects

Post by krstcs » Wed May 14, 2014 2:21 pm

Well, I would stay away from copying any files from one Project to another as Ranorex identifies everything (Modules, Variable, Projects, data sources, etc.) by GUIDs, so if you copy it you will run into conflicts over GUIDs.
Shortcuts usually aren't...