Add Variable in Base xPath.

Ask general questions here.
arunviswa
Posts: 5
Joined: Thu Sep 13, 2018 10:51 pm

Add Variable in Base xPath.

Post by arunviswa » Tue Mar 10, 2020 10:37 pm

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

/dom[@domain~'test+$domainURL+.google.com']

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

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

Re: Add Variable in Base xPath.

Post by odklizec » Wed Mar 11, 2020 8:11 am

Hi,

You must enclose the expression in quotes, like this:
/dom[@domain~'test' + $domainURL + '.google.com']
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

arunviswa
Posts: 5
Joined: Thu Sep 13, 2018 10:51 pm

Re: Add Variable in Base xPath.

Post by arunviswa » Wed Mar 11, 2020 4:07 pm

Thank you so much. Its working fine now

arunviswa
Posts: 5
Joined: Thu Sep 13, 2018 10:51 pm

Re: Add Variable in Base xPath.

Post by arunviswa » Fri Mar 13, 2020 6:08 pm

Hi,

I was mistake with the default value. Could you please explain how to pass values to the repository variables?

Thanks,
Arun V