How to rename a project and its namespace in Ranorex?

Ask general questions here.
lukaskupasz
Posts: 1
Joined: Wed Jun 06, 2018 1:48 pm
Contact:

How to rename a project and its namespace in Ranorex?

Post by lukaskupasz » Wed Jul 04, 2018 11:21 am

Since the naming of our project changed, I would like to concistently reflect that change in project-names and namespaces within my solution. Also, the standard test suite file files (.rxtst, .rxtmg, .rxrep) should be renamed accordingly.

What I tried:

Renaming the solution and projects within the Ranorex IDE works fine.

Renaming the standard test suite files in the Ranorex IDE will rename all references, except for references to the repository within CodeModule files. These will point to the previous repository name, resulting in compile errors.

Renaming the namespaces in the Ranorex IDE is not supported. Renaming (refactoring) the namespace in Visual Studio works in that the solution will compile just fine afterwards when compiled in Visual Studio. However, opening the solution in the Ranorex IDE will regenerate the code of recording modules, which still point to the previous, no longer valid repository name, resulting in compile errors.

Any suggestions how to handle the scenario efficiently, consistently and correctly? Many thanks in advance!

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

Re: How to rename a project and its namespace in Ranorex?

Post by odklizec » Thu Jul 05, 2018 12:19 pm

Hi,

I would search a replace all instances of old name, using a good programming editor, e.g. notepad++. Just make sure you have a working copy of solution stored in your vcs ;)
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

keeso
Posts: 1
Joined: Mon Dec 05, 2016 12:27 pm

Re: How to rename a project and its namespace in Ranorex?

Post by keeso » Wed Jun 26, 2019 2:51 pm

Using this thread because it is not locked yet :)

I also have a testsuite that I want to rename. I have tried it with Notepad++ but I didn't do it correctly so it became a read only suite. The problem I have is that that name of the project files does not change. A lot of names inside the files were changed but I need the filenames to be changed too. Can a kind soul tell me exactly wich settings I need to use when using Notepad++ . If this is possible at all.

Thanks in advance.

UPDATE: I did it with notepad++ for the names inside the files and I renamed the files (about10-15) manually.

MichalSk
Posts: 34
Joined: Fri Jul 10, 2020 9:23 am
Location: Pforzheim, Germany

Re: How to rename a project and its namespace in Ranorex?

Post by MichalSk » Wed Sep 02, 2020 7:32 am

Hello everybody,

I also wanted to rename my project files, and as some of you mentioned, used a tool to rename all instances.
In my case I used ReSharper in VS Studio, but I guess I didn't renamed all instances because some files had still the old name..

Is there anywhere a tutorial which files/instances have to be renamed? If not, could somebody make a short tutorial, to make it right?

Thanks!

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

Re: How to rename a project and its namespace in Ranorex?

Post by odklizec » Wed Sep 02, 2020 8:06 am

Hi,

I would suggest to use Notepad++ and its "Find in Files" tool (Search menu). Then simply search and replace project files you want to rename in entire solution. Of course, before renaming project files, don't forget to make a copy of last working state of your solution to source control of your choice ;)
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

MichalSk
Posts: 34
Joined: Fri Jul 10, 2020 9:23 am
Location: Pforzheim, Germany

Re: How to rename a project and its namespace in Ranorex?

Post by MichalSk » Wed Sep 02, 2020 9:22 am

Thanks for the reply.

I already read that suggestion from you, but which of the files in the directory where I have all my files, should i open and use the rename functionality from notepad? For example if i want to rename one project inside a solution, which files should I open in Notepad++ and rename??

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

Re: How to rename a project and its namespace in Ranorex?

Post by odklizec » Wed Sep 02, 2020 9:43 am

Hi,

Well, as for renaming files (file names), you should do it one by one for example in file explorer or a file manager of your choice. As for changing names inside the solution files, you should do it via this dialog in Notepad++...
FileRename.png
FileRename.png (12.24 KiB) Viewed 79 times
Basically, you have to specify all files to be searched/renamed via filters mask *.*
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

MichalSk
Posts: 34
Joined: Fri Jul 10, 2020 9:23 am
Location: Pforzheim, Germany

Re: How to rename a project and its namespace in Ranorex?

Post by MichalSk » Wed Sep 02, 2020 11:59 am

Alright, that looks helpful! I will try it soon, and this time, hopefully without any problems :D

Thanks for the Explanation.