Page 1 of 1

How can i set Ranorex to not use src in XPATH?

Posted: Thu Jul 16, 2020 7:58 am
by ducarpit
Hi,
i have a problem when i recording some tests on a web application.
As you can see in the image,
ranorex_src.JPG
Ranorex memorize the XPATH of some elements with the src identifier instead of id (for example).
That's not good for me because at the next run, the src is not the same and the test crash.
I have to sobstitute the src identifier with id or others by hand, and that's very frustrating.
Is there a way to tell Ranorex not to use the src identifier for the XPATH for the elements?
Thanks a lot in advance...
Christian

Re: How can i set Ranorex to not use src in XPATH?

Posted: Thu Jul 16, 2020 10:32 am
by odklizec
Hi Christian,

Yes, it's possible to omit "src" from xpath generation procedure, by lowering its xpath "weight", or by increasing xpath weight of different attribute, you want to be used instead of "src". For more details about xpath weight, please check this user guide chapter...
https://www.ranorex.com/help/latest/ran ... namic-ids/
Basically, you must create a new weight rule, where you should specify "src" attribute with "0" value. By default, iframe src attribute has weight value set to 150. Just decrease this value and you are good to go ;)
2020-07-16_11-35-44.png

Re: How can i set Ranorex to not use src in XPATH?

Posted: Thu Jul 16, 2020 3:02 pm
by ducarpit
odklizec wrote:
Thu Jul 16, 2020 10:32 am
Hi Christian,

Yes, it's possible to omit "src" from xpath generation procedure, by lowering its xpath "weight", or by increasing xpath weight of different attribute, you want to be used instead of "src". For more details about xpath weight, please check this user guide chapter...
https://www.ranorex.com/help/latest/ran ... namic-ids/
Basically, you must create a new weight rule, where you should specify "src" attribute with "0" value. By default, iframe src attribute has weight value set to 150. Just decrease this value and you are good to go ;)
2020-07-16_11-35-44.png
Hi,
thanks a lot, i made a simple test to try this solution and it seems work!
Is there a way to set up this xpath setting for all the projects?
Or have i to do this for each projects?
Thanks a lot in advance

Christian

Re: How can i set Ranorex to not use src in XPATH?

Posted: Thu Jul 16, 2020 4:10 pm
by odklizec
Hi,

You can import settings from one project to another. Open the project you want to update with new src weight rule, open settings and there you should see Import button. Then select rxsettings from the project you already updated. That's all.

Re: How can i set Ranorex to not use src in XPATH?

Posted: Mon Jul 20, 2020 10:14 am
by ducarpit
odklizec wrote:
Thu Jul 16, 2020 4:10 pm
Hi,

You can import settings from one project to another. Open the project you want to update with new src weight rule, open settings and there you should see Import button. Then select rxsettings from the project you already updated. That's all.
Hi,
i tried but unfortunalty i didn't find the settings tab and the Import button.
Where they are?
Thanks a lot
Christian

Re: How can i set Ranorex to not use src in XPATH?

Posted: Mon Jul 20, 2020 11:09 am
by Stub
Down at the bottom-left of the Settings dialog.

Re: How can i set Ranorex to not use src in XPATH?

Posted: Tue Jul 21, 2020 8:03 am
by ducarpit
Stub wrote:
Mon Jul 20, 2020 11:09 am
Down at the bottom-left of the Settings dialog.
Hi,
maybe i have to add some panels because i don't see the Setting dialog:
setting_dialog.JPG

Re: How can i set Ranorex to not use src in XPATH?

Posted: Tue Jul 21, 2020 8:23 am
by Stub
Press the "Open Settings" button on the toolbar to invoke the Settings dialog.