Forum Discussion
This is a link explaining the process of reading data from a file. This takes to the KWT section and has a few links to more details.
https://support.smartbear.com/testcomplete/docs/testing-with/data-driven/retrieving-input.html#keyword-test-operations
Changing the Data Type of the Retrieved Value
TestComplete uses DDT Drivers to retrieve information from a storage. In most cases, the data is retrieved as a string. However, it can also be retrieved as an integer. Some methods perform different actions depending on whether you use integers or strings. For example, the ClickItem action performs a touch on an item using its index if you use an integer, but if you use a string, it searches for the corresponding item caption.
If you need to change the data type, use the VarToStr and VarToInt methods to make sure that you use a string or an integer value.
To use these methods in keyword tests, do the following:
- Double-click the Value cell of the Keyword Test operation to open the Parameters Editor.
- Click the ellipsis button.
- Copy the contents of the Value field to the Clipboard.
- Change the Mode option to Code Expression.
- In the value column, type in either VarToStr() or VarToInt().
- Paste the Clipboard contents inside the parentheses and click OK.
In scripts, use these methods to change the data type of the value you retrieve, for example, VarToStr(Driver.Value(5)).