Forum Discussion

sealockw's avatar
sealockw
New Contributor
13 years ago

Data driven test won't stop

Hi All,



Having an odd problem with a data driven test - being fairly new to TestComplete I thought I'd post this here to see if anyone has had a similar problem.  We created a data driven keyword test to validate some data on one of our forms, and it works pretty good.  We are using an Excel worksheet for our data, there is about 200 rows and 5 columns of data, and there are no blank cells in any of the data.  The problem we're having is that the first 200 times through the data driven loop everything works fine, however, TestComplete tries the loop 201 times, and of course that last time it fails because the entire row is empty.  In the data driven loop we did not define how many rows to execute as we expect this list of data to expand as time goes on.  We've tried everything else, i.e., validating that rows 201+ are all entirely blank.  We've even tried reducing the number of rows down to 4 and TestComplete still tries the loop 5 times.  We've also copy and pasted just the table data to a new Excel sheet and it still tries to do more data driven loops than data rows.  The especially odd thing is that when we were developing the test we started with a sheet with 4 rows of data, and it worked as expected.  This problem started after we expanded the worksheet to 200 rows of data, and the problem continues even if we reduce the worksheet to the original 4 rows of data.



So, is TestComplete supposed to automatically figure out the end of the Excel file?  Has anyone else had an issue like this?



Thanks.

2 Replies

  • chicks's avatar
    chicks
    Regular Contributor
    Hi,



    Most of my tests are data driven from excel files.   I'm using the following standard template.(javascript).

    I think the only time I've seen similar behavior is when I've got extra rows in the data sheet and I can typically check

    for this by doing a ctrl 'down arrow' to check the last row that excel thinks is defined.



    Regards,  Curt Hicks

    .



        var Driver = DDT.ExcelDriver(excelData, " < sheet name> ", true);

        

        var rowNbr = 0;

        var index = 0;

         

        var reply, replyObject;

        var dataFetchedWithNoError;  

        

        while (! Driver.EOF() ) {

            omit = aqConvert.VarToStr(Driver.Value(omitHeader));

            // skip row if there's anything other than whitespace in the omit column



            if ( /\S+/.test(omit) == false) {

                rowNbr++;

                Log.Message ("non-omitted data row : "+rowNbr );

                // read rest of expected data

                 <data> = aqConvert........  blah blah bla

          

                // Fetch data for comparison

                 

          

           

                if ( dataFetchedWithNoError ) {

            

                    Log.PushLogFolder(Log.CreateFolder(" verifying row "  ) );

                    

                    // compare returned data with expected data

                    

                    Log.PopLogFolder();          

            

                }   // END IF - do verification if no error in the API call

         

                index++;

             

            } // END IF - row was not omitted

            Driver.Next();

        }  // END -WHILE

         

        DDT.CloseDriver(Driver.Name);

         

        if ( 0 == rowNbr) {

            Log.Warning("No data rows existed in the spreadsheet ");

        }
  • sealockw's avatar
    sealockw
    New Contributor
    Hi Curt,



    We've tried everything we can think of looking at the data, even starting with a new Excel worksheet containing no content from the original and still the problem exists.



    What we ended up doing was re-recording our test and re-building the data driven portion of the test.  This new one works fine with the full Excel file.



    Weird.



    I can only surmize that we did something in the original test that caused some odd interaction with Excel - given that it was a keyword test to begin with, I'm not sure how, but that is what happened.



    For now I'm going to assume the problem is resolved and if we keep having a problem like this we'll open a support case.



    Thanks.