Forum Discussion

Zman_Tester's avatar
Zman_Tester
New Contributor
9 years ago

Data drive loop doesn't end at the end of the last row

Hi, I am trying to create data-driven loop.  I have an Excel spreadsheet where I store 'order numbers' and using TestComplete I am attempting to 'Complete' them. I have created the loop fine and it...
  • dmiscannon's avatar
    dmiscannon
    9 years ago

    To set a breakpoint, click as shown below.

     

    When you run the script, TC will pause the test when it reaches the breakpoint. Then press F11 to advance the script one step at a time. The step being executed will be higlighted by TC. This may help you determine why the script is not performing as you want.

     

    Another possible solution would be to use an If..Then statement. In your Excel file, put a number, such as 9999, in the "Order Number" column in the row after the last row you wish to include in your test. Then, in the test, have an If..Then statement checking the value of "Order Number." If "Order Number" = 9999, use a Go To label to exit the DDT loop. Below is an example.

    The above is not ideal, but it may get the test to work while to you continue to debug the script.