Different URL

Best practices, code snippets for common functionality, examples, and guidelines.
MB_wiko
Posts: 93
Joined: Fri Sep 09, 2016 1:05 pm
Contact:

Different URL

Post by MB_wiko » Mon Nov 07, 2016 12:11 pm

Hello Together,

I'm just new with ranorex and I didn't find an answer for following question:

We have 2 different test systems with different URLS. At the moment I change the ULR in global parameters and in 2 DOM-objects. Is it possible to define a global parameter for these 2 DOM object? What is you best practise in this case? We test a web application.

Thanks a lot in Advance

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

Re: Different URL

Post by odklizec » Mon Nov 07, 2016 12:41 pm

Hi,

If the only difference between the two systems is URL (and the structure under DOM element remains the same), then you can add both addresses to the xpath, using 'or' operator, e.g. like this:

Code: Select all

/dom[@domain='url_1' or @domain='url_2']
Of course, you can use also repo variable connected to global parameter. But keep in mind that if you use variable at DOM level, you will have to bind the variable to global parameter in EVERY single recording/code module! Usually, it's not a problem. It's just that you must not forget about it and use the Auto-Bind whenever possible.
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

MB_wiko
Posts: 93
Joined: Fri Sep 09, 2016 1:05 pm
Contact:

Re: Different URL

Post by MB_wiko » Mon Nov 21, 2016 1:33 pm

Thanks a lot, it helps me.