Forum Discussion

julie_mcmanus's avatar
julie_mcmanus
Occasional Contributor
11 years ago
Solved

DDT Driver.First() Method

Hi,

I am having problems with the Driver.First() ,method using DDT on an excell sheet.  Running the sample code



...

 

// Obtains a driver

var Driver = DDT.ExcelDriver("..//..//MyTestBook.xlsx", "TestSheet", true);



// Run some test with the driver

Result = MyTestRoutine(Driver);

  

// If an error occurs ...

if(! Result)

{

  Driver.First(); // Go to the first record

  MyTestRoutine(Driver); // and repeat the test

}

 

...



gives the error "
 object doesn't support this property or method"



any idea what I'm doing wrong here?

Thank You
  • Most probably you use older version of TestComplete. For example, in v.8 there is no such method. I don't have TC 9 installed here, but it seems like method First was introduced in TC 10.

5 Replies

  • karkadil's avatar
    karkadil
    Valued Contributor
    Most probably you use older version of TestComplete. For example, in v.8 there is no such method. I don't have TC 9 installed here, but it seems like method First was introduced in TC 10.
  • julie_mcmanus's avatar
    julie_mcmanus
    Occasional Contributor
    THanks, it could be that as I am using TC 8.70.  

    Any suggestions as to how I can get to the first row in my sheet?  I'm itterating through the rows using EOF to detect when I reach the end of a column.  When I move onto the next column I need to go to the first row again but EOF is still true.
  • karkadil's avatar
    karkadil
    Valued Contributor
    The best solution is to read ALL columns on each row iteration and then move to the next row. You will need additional FOR for this, but it is a better approach.
  • julie_mcmanus's avatar
    julie_mcmanus
    Occasional Contributor
    I can see how this would work but it doesn't really suit my test.  

    I've decided to close the driver and reopen for each column I want to itterate through which works for me.



    Thanks for the advice.
  • Marsha_R's avatar
    Marsha_R
    Icon for Champion Level 3 rankChampion Level 3
    I would have switched the columns to rows and let one iteration work with one row of data.