Page 1 of 1

How do I create a repo variable linked to a datasource?

Posted: Thu Jun 13, 2019 4:26 am
by Cyclops
Howdy,

This doesn't need to change during execution. I just want to be able to run the tests on any domain I need to.

Testing over multiple domains means that I need the 'ApplicationUnderTest' in the repo to be dynamic.
So instead of ApplicationUnderTest /dom[@domain='blah.test.com.au']
I would like ApplicationUnderTest /dom[@domain=$QAUnderTest+'.test.com.au']

I would like to be able to link $QAUnderTest to a datasource I have.

I assume I am going about this the wrong way, but I am sure someone will set me straight!

Re: How do I create a repo variable linked to a datasource?

Posted: Thu Jun 13, 2019 8:17 am
by Stub
You can configure that Repository variable via a code module that reads your datasource, if that is appropriate to your scenario. Or if it's a data-driven test that you run across multiple domains, then you can connect a field in the datasource to that Repository variable in the Ranorex UI via the Data Binding tab on a Test Case or Smart Folder.

Re: How do I create a repo variable linked to a datasource?

Posted: Thu Jun 13, 2019 8:30 am
by odklizec
Hi,

You just need to use a 'regex' operator, instead of simple 'equal' operator:
/dom[@domain~$QAUnderTest+'.test.com.au']

Re: How do I create a repo variable linked to a datasource?

Posted: Fri Jun 21, 2019 4:05 pm
by Franz
The RxPath you posted is correct for your purpose.

In this case the '$QAUnderTest' is a repository variable, you can bind the variable easily to a datasource that can append on any smartfolder in your testsuite.

Open your testsuite and add your TestModule inside of a SmartFolder, after doing so you should see something like this: Unbound variables: 1 in the datasource column.

Just doubleclick on it and the datasource window should appear where you can bind your variable on any parameter or datasource column.

If you are not in mind to change the domain during execution then i would suggest to use a global parameter instead thats called 'CurrentDomain' and bind it to the 'QAUnderTest' variable. You can change the value of the 'CurrentDomain' parameter anytime.

Otherwise you can use a .csv file to define multiple domains where each row represents the current domain that will be saved in your 'QAUnderTest' Repo Variable.