Page 1 of 1

How to force Ranorex "Adapter" to be used as Variable

Posted: Fri Feb 16, 2018 9:09 am
by _KK_
Hello Forum!

Ranorex XPath consists of Adapters, Attributes and Values.

To make a module more "generic", it is preferred to use variables and use them later in DDT (data driven test).
But "Adapters" in Ranorexpath cant be forced to be a variable.
Examples for Adapters:
form
Container

button (useful to have it as variable)
progressbar (useful to have it as variable)
text (useful to have it as variable)

Example of XPath with variables for "Attributes" automationid and visible:

Code: Select all

.//form[@automationid='AID_Test']/progressbar[@automationid=$AutomationId and @visible=$visible]
The "Value" is in both cases a different variable.

When trying to change the Adapter progressbar into a variable, the Rx-Studio wont accept this.
Has someone an explanation for that?

Thanks in advance.

BR

Klaus

Re: How to force Ranorex "Adapter" to be used as Variable

Posted: Fri Feb 16, 2018 10:23 am
by odklizec
Hi,

The explanation is simple. Variables are currently supported only in values. Neither adapters nor attributes could be variabilized in current implementation of Ranorex xpath. The only thing you can probably do is to replace adapter with * character, which means “any” adapter. And of course, you can make a feature request via User Voice platform.

Re: How to force Ranorex "Adapter" to be used as Variable

Posted: Fri Feb 16, 2018 12:13 pm
by _KK_
Hi Pavel,

the asterisk made my day! :D

Thanks for this really awesome proposal which is excellent working.
In my case I can reduce the number of DDT files to 25% when having 4 different Adapters to be tested with so many controls as you like.


BR

Klaus