Studio "Search/Replace" feature for element xpath?

Ranorex Studio, Spy, Recorder, and Driver.
qa-auto
Posts: 86
Joined: Mon Aug 05, 2019 10:46 pm

Studio "Search/Replace" feature for element xpath?

Post by qa-auto » Thu Feb 27, 2020 5:57 pm

Hi, Ranorexors,

I want to update a lot of the xpath in my repos from

.//input[@id='ctl00_ctl00_MainContent_ChildContent1_loanOrigination_txtCheckNumber']

to


.//input[@id<'loanOrigination_txtCheckNumber']

Can you do a search/replace in Studio? repos.cs is locked so can't do it there. I think the answer is no, but I want to be sure before I update each individual element.

Thanks!
Lorinda

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

Re: Studio "Search/Replace" feature for element xpath?

Post by odklizec » Thu Feb 27, 2020 6:20 pm

Hi Lorinda,

The best (and probably the only) way is to edit the rxrep file, using a good text editor, with search&replace functionality. But before you edit the file, make sure you have a backup copy of last working version (ideally, stored in source control). Once the file is edited, you need to rebuild entire solution. Hope this helps?
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

qa-auto
Posts: 86
Joined: Mon Aug 05, 2019 10:46 pm

Re: Studio "Search/Replace" feature for element xpath?

Post by qa-auto » Mon Mar 02, 2020 5:08 pm

Hey Pavel,

Thank you - that did help! I backed everything up then did a mass find/replace. But, that file then wouldn't load because of badly formed XML. I couldn't though figure out what the source of it was so I reverted back, then did manual updates for times sake. That was a good tip though!

Take care,
Lorinda

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

Re: Studio "Search/Replace" feature for element xpath?

Post by odklizec » Mon Mar 02, 2020 5:18 pm

Hi,

Apparently, the file editing operation corrupted the file? Unfortunately, without seeing the file and knowing which editing app you used, it's hard to tell what caused the corruption. I'm using Notepad++ or PSPad and both work great.
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