Forum Discussion

alisson_cruz's avatar
alisson_cruz
New Contributor
11 years ago

Excel Data-Driven doubt

Hi,



I'm trying to use a .xls file to get values for a test, but there's a point where it doesn't go well.



The tests are working fine, they are using values in 2 columns of a excel table. The problem is: TestComplete can't identify where it should stop reading rows.

TestComplete are correctly getting value after value, row after row.. however when it gets in a empty row, it tries to get the value and thows a exception (because this value doesn't exist, it's a blank cell).



At "Data-Driven Loop", I already defined "Start record > From the beginning" and "End record > To the end", and it doesn't work.

The test only works perfectly when I define a "End record > To record <number max of filled rows>"





At "Open Data Generator" I left the default parameter: "Integer - Sequence from 1 to 2147483647, the increment value is 1 | x1"





Thanks.
  • It's not the most elegant solution, but when I had this happen, I copied the specific cells out of my Excel sheet into a new sheet and the new one worked.  



    I never could fix the old sheet.  Best I could figure out was that there was some hidden Excel junk in the extra rows that TC was picking up.  



  • It's not the most elegant solution, but when I had this happen, I copied the specific cells out of my Excel sheet into a new sheet and the new one worked.  



    I never could fix the old sheet.  Best I could figure out was that there was some hidden Excel junk in the extra rows that TC was picking up.  



  • Wonderfull!

    It works perfectly.. thank you!



    What looks funny now is that with the old XLS, at variable list, there were the columns F2 F3 F4 that should be empty!!

    And now it's gone!

    • mgroen2's avatar
      mgroen2
      Super Contributor

      alisson_cruz Just curious: what is/was the problem? that TC cannot handle empty (or hidden) cells when it's doing DDT?

      • Marsha_R's avatar
        Marsha_R
        Moderator

        In our experience, TC can handle empty and hidden cells just fine.

         

        The problem seems to be that even though it looks like we have cleared out a cell, there is some invisible-to-the-user Excel formatting saved in it and TC will read it as not-empty and try to process it, thereby causing the test to fail.

         

        We spent many hours trying to fix these sheets when we first encountered the issue and it is much quicker to just cut and paste the wanted data into a new sheet and move on.   Since we only see this when we are first entering the data and not after the test is well established, it isn't much of a concern.