Page 1 of 1

Change the Xpath automatically after a weight rule

Posted: Thu May 18, 2017 6:08 am
by AgileTesterCarlo
Hi,

We are running a POC on an Outsystems application. Outsystem generates a webpage and it generates new id's for the same element like this: test_<changingID>_Username
The last part of the element stays the same so we created a weight rule to have Ranorex identify the element.
This works fine.
The next thing we like to do is that it removes everything in the xpath before the '_Username'. This is now done by hand for each repository item, but as this applies to 99% of the repo-items, it would be nice if we could do this automatically when the item is added to the repository or a bulk update on the repo-items.
Is this possible?

Kind Regards, Carlo

Re: Change the Xpath automatically after a weight rule

Posted: Thu May 18, 2017 9:55 am
by odklizec
Hi Carlo,

I'm afraid, the only way how to achieve what you want is to edit the rxrep file in a good text editor (e.g. notepad++) and simply remove/replace the parts of xpaths you no longer need.

Re: Change the Xpath automatically after a weight rule

Posted: Thu May 18, 2017 6:40 pm
by Vaughan.Douglas
You might be able to get this done by nesting your objects into rooted folders, but I'm guessing you want this done without manual intervention.

You could probably build a script that reads in the rxrep file and edit the XML as odklizec mentions. Is this purely for cosmetics or is the RxPath not valid?

Re: Change the Xpath automatically after a weight rule

Posted: Fri May 19, 2017 8:06 am
by AgileTesterCarlo
Thanks, changing the rxrep file outside of ranorex is an option we did not think of yet.
The xpath changes are necessarry at least each build as outsystems changes the first part of the ID on every build. We can build some automated script for that.