Page 1 of 1

How to search and replace an xPath in multiple solutions?

Posted: Wed Nov 08, 2017 11:41 pm
by mariya.syera
Windows 10, 64-bit operating system
Ranorex version 7.0.1

Trying to replace an xPath in few solutions using the main folder that they are all located in.

Note: when I search for that xPath in the current solution while having it open it finds it in the user code with no issues.

Any suggestions on how I can make it work? (I tried using different options provided in this tool still can't find it)

Re: How to search and replace an xPath in multiple solutions?

Posted: Thu Nov 09, 2017 1:34 pm
by qwertzu
hi,
Have you tried to use the "Match Case" option?
However, I´m not sure if its a good idea changing the paths by using this replace function. I´d rather suggest changing the paths by editing the elements in the repository.
regards, qwertzu

Re: How to search and replace an xPath in multiple solutions?

Posted: Fri Nov 17, 2017 6:40 pm
by mariya.syera
Hi,
I have tried using Match Case option still doesn't work.
Also I realized that Search and Replace only searches in the user code and not the repository. When it replaces it also only replaces in the user code and no changes done on the repository xPath.

Any ideas why it doesn't find it in the Repository Path?

Re: How to search and replace an xPath in multiple solutions?

Posted: Mon Nov 20, 2017 2:30 pm
by odklizec
Hi,

The problem is, that the repository xpath is stored in rxrep (xml) file, from which is auto-generated a corresponding cs file. And I guess the rxrep file is most probably not included in search&replace tool. I would suggest to use an external file editor (like notepad++) to search/replace all solution files. But before you do that, make sure the working version is stored in source control system, so you can always return back the last working state ;)

Re: How to search and replace an xPath in multiple solutions?

Posted: Tue Dec 12, 2017 6:19 pm
by mariya.syera
Where would I see the XML file? The only XML file I see is the XML Configuration which does not store my repositories.

Re: How to search and replace an xPath in multiple solutions?

Posted: Tue Dec 12, 2017 6:52 pm
by krstcs
Technically, every file that has an ".rx..." extension is XML. RXTST, RXREP, RXREC, etc. XML is the format of the text data inside the files. Ranorex just uses specific ".rx*" naming for the XML files they use to define the actions, repo, and suites. In .NET terms these XML files are paired with code files (*.CS and *.USERCODE.CS), all named the same, except the extensions, that together define that particular part of the overall Ranorex framework.

In this case, the most likely files that should be looked at are the *.rxrep and similarly named *.cs files.



I would also highly recommend that you open Windows Explorer and under the "View" tab, uncheck the "Hide extensions" checkbox as this will allow you to see the actual file types more easily. Microsoft decided a while back to default this setting to be ON, which can cause issues with security, not to mention that it makes identifying files a little more difficult.