How to easily copy Recordings

Ranorex Spy, Recorder, and Studio.
craigmachaffie
Posts: 9
Joined: Tue Aug 17, 2010 2:58 pm

How to easily copy Recordings

Post by craigmachaffie » Tue Aug 17, 2010 3:02 pm

I have a recording inside of a solution that i wish to copy and modify. What is the best way to do this? I previously tried manually copying the three files (the .rxrec, the .cs and .UserCode.cs) to new names in the same directory (via windows explorer). I then added the rxrec as an existing file--but the copy of the recording seems to be hard linked to the original--I cannot change the class name (and end up with two recordings claiming to be the same class in the .cs files, which cannot be modified). Any help would be much appreciated.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to easily copy Recordings

Post by Support Team » Wed Aug 18, 2010 1:04 pm

Hi,

Sorry, but presently there is no simple way to copy recordings. We know about that lack and will add this functionality in a future release of Ranorex. The safest way currently is to create a new recording and duplicate the steps manually. But you can use following workaround to copy recordings:
  • Copy the rxrec file named "Recording1" with Windows Explorer.
  • Rename the rxrec file "Recording1" in the Ranorex Studio Project Tree to Recording2. When asked to change the class name as well, answer yes.
  • Rename the copy of the original "Recording1" to its former name with Window Explorer.
  • Now include the original "Recording1" to your project and it is copied.
Regards,
Peter
Ranorex Team
.
Image

adrian.stoll
Posts: 1
Joined: Tue May 03, 2011 8:02 am

Re: How to easily copy Recordings

Post by adrian.stoll » Thu May 26, 2011 3:49 pm

Peter (or whoever is going to answer this on behalf of Ranorex)

I did follow the steps above and I have now duplicated the recording as expected and added it to the project.

However, if I try to include the copied (and modified) recording into my Test Suite, there is a problem.

1. At first the new recording appears
2. But when I build the project, it is replaced again with the original.

For example, I have copied the Recording1 and add Recording2 to the Test Suite. At first I have Recording1 and Recording2, but if I build the project, I have Recording1 twice in my test suite, not Recording2 anymore.

What I found out is that in the generated code, the following line is identical, no matter if I modify any of the Recordings:

Code: Select all

[TestModule("af12cd4c-6b4a-4a2b-91e4-7b741f5a8cb4", ModuleType.Recording, 1)]
It seems as this is some kind of unique identifier that does not get replaced when the file is duplicated? Maybe this causes the problem? Is there a workaround?

Please advise how to fix this

Kind regards,
Adrian

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to easily copy Recordings

Post by Support Team » Fri May 27, 2011 10:50 am

Hi,
adrian.stoll wrote:It seems as this is some kind of unique identifier that does not get replaced when the file is duplicated? Maybe this causes the problem? Is there a workaround?
Did you update to the latest version of Ranorex? If not please use following link http://www.ranorex.com/download/Ranorex-3.0.2.exe to install Ranorex 3.0.2. We changed the code generation in this release and we also improved the project tree in Ranorex studio. Now you should be able to copy files in the project tree. I would suggest you to create an folder inside your project with your "Template Recording", then you can copy it to most every place you want. Then rename the copied one and the code gen create a new GUID, which is the unique id you saw.

Regards,
Peter
Ranorex Team
.
Image