Forum Discussion

Louis's avatar
Louis
Contributor
15 years ago

Type mismatch when using dat adriven testing.

I am using a data driven keyword script to label peaks on a graph. I am having problems when the values within a column of my driving data switches from a numerical value to a letter value or vice versa. For example test complete will label (using the wtext command) a peak as 12 on the first loop then 13 on second loop but when it attempts to label the peak as R the script stops and the log shows a type mismatch error.  have tried using the data in csv format and excel format when using the excel data to drive the test i formatted all cells in the work sheet as text and that didn't help. Seems like testcomplete is judging what sort of data should be entered for each peak (integer or letter) then refuses to change. I thought it would just blindly enter the data I provided it with.
  • Hello. The control doesn't seem to be the problem. Definitely something to do with the reading of the data. Yesterday evening off the back of you suggesting trying to type a problem value without data driving, I managed to come up with a work around for this problem. As the problem occurs if the driving data within a given column switches from numbers to letters I have performed a global replace on my driving data swapping all letters for a previously unused number e.g. replace all R values with 88. I have then used the "if then" command to call a second keyword script when the value 88 in encountered.The second script is short and simple script which uses the wtext command to type R within the control. This seems to work pretty good. I know its not ideal but until we can get to the bottom of this its a fix.
  • Hi Louis,


    I am glad to hear that you've found a workaround. Let us continue working further via e-mail in the support case you started.

  • tgrubb's avatar
    tgrubb
    New Contributor
    FWIW, I have found if you assign the DBvariable to a local string variable and then pass the local variable into the Key Press, it works.