Printer FriendlyEmail Article Link

iTest - How to use field substitution on iTest?

iTest 6.x - Latest

iTest - How to use field substitution on iTest?

On this document you will find how to use the field substitution feature in iTest.
The Field Substitution is a feature that allows the internal iTest interpreter to “parse” the string on a field to look up for any variable inside of it, when it is enabled.
Many different session profiles and command steps on iTest have a little “F” checkbox just at the end of the field name, for example on an SSH session open step:

That little “F” means that the Field Substitution is enabled, by default this feature is enabled in all the fields.

To disable the field substitution, just toggle the little “F” checkbox with a left click, the “F” will be gone letting you know that the feature is now disabled.
You can see the difference on the next image:

As an example, let’s consider that we want to get some of this fields values “ip address, user and password” from variables set at the beginning of the code.

As you can see you can get the variable contents directly or use internal substitution commands with [get VarName] useful when we want to get the values from a parameter file.
If you disable the field substitution the contents of the IP address for example will be taken literally, you will get a connection error since the string “$ip” is not a valid IP or FQDN.

This is just an example of the many different ways you can use the field substitution feature to turn your test cases furthermore automated.

Python Syntax and Field Substitution feature:

Of course you can use this feature as well while using Python syntax, the only difference is that you need to make use of “[ ]” enclosure in order to let iTest know that what you are writing is a variable and not regular string.



Product : iTest