Add Variable in Base xPath?

Ask general questions here.
Posts: 1
Joined: Sun May 24, 2020 9:30 am

Add Variable in Base xPath?

Post by ThomasMateo » Thu May 28, 2020 6:44 am

Based on the input (Missouri, Iowa, California) i have to modify the Base xPath in Ranorex repository.
If Missouri, it should be
if Iowa, it should be
if California it should be


I have created a variable called domainURL and thru data binding passed a value for domainURL but it is not working.

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

Re: Add Variable in Base xPath?

Post by odklizec » Thu May 28, 2020 7:31 am


The xpath with variable must look like this:
I personally don't like the idea to have variables in DOM, because it means I have to bind every single recording using repo elements ;) So in situation like yours, I prefer to 'hardcode' the variable strings, like this:
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