I am using a CSV for a Data-Driven loop but it's not working with a numeric option list
I'm testing a web application and I've created a csv for my Data-Driven loop. It was working great until I tried to populate a numeric option list (a list of about 60 four digit branch numbers). Instead of using the value from the csv to set the option list text, it is attempting to set the option list index. As a result it throws an index out of bounds error.
For example: if the branch number in the csv is 1500, rather than selecting 1500 from the option list values, it tries to set the index to 1500. This happens in both IE and Chrome. I haven't tested Firefox yet, but I suspect it will do the same thing.
If I use a variable, parameter or a constant rather than using the csv, it selects the numeric value. It only fails when loading data from a csv.
Any ideas how to get around this?
Thanks,
Judy
Hi Judy,
You did not mention how you are trying to set the value to the options list, but some methods provided by TestComplete can accept both a string and an integer as parameters. And if the integer is provided as a parameter then the method selects an item by the index. This is documented in the relevant help topics.
So I would suggest to convert the parameter to string (e.g. using the aqConvert.VarToStr()) and check if it helps.
Alternatively, you may explicitly provide a string parameter (e.g. like .<Method>('"' + aqConvert.VarToStr(<parameter>) + "'") )
Ah, right... because it's not being called as a "table data" mode, you need to call it a bit differently...
try.
aqConvert.IntToStr(KeywordTests.Checkin.Variables.POData.Value("Branch"))