I have created variable 'varDomain' in the reposiotory and mapped to dom (/dom[@domain=$varDomain]).
Then I created global parameter varaible 'AppDomain' at Test Suite level.
I want to assign global parameter value to repository variables from usercode during runtime.
I am using following line:
Repository.Instance.varDomain = Testsuite.Current.Parameters["AppDomain"]
It is working fine as expected. But I have to use above line for every user code method which uses repo items.
It's like a repetitive. Is there any better way to handle this scenario?
Thanks in advance
Assign global variable value to repository variables from User code .
-
- Posts: 2
- Joined: Wed May 19, 2021 2:23 am
Re: Assign global variable value to repository variables from User code .
Hi,
The solution is not to use variable in domain name I personally hated the need to databind variable with every single recording/code module using repository. So I simply replaced variable with multiple hardcoded domain names, separated by conditional keyword "or". Like this...
The solution is not to use variable in domain name I personally hated the need to databind variable with every single recording/code module using repository. So I simply replaced variable with multiple hardcoded domain names, separated by conditional keyword "or". Like this...
Code: Select all
/dom[@domain='doamin_A' or @domain='domain_B' or @domain='domain_C']
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
-
- Posts: 2
- Joined: Wed May 19, 2021 2:23 am
Re: Assign global variable value to repository variables from User code .
Thank you for your suggestion.