Forum Discussion

lcorkren's avatar
lcorkren
Contributor
12 years ago

DDT break

I have an application that requires a unique firstName, lastName and taxpayerID,  We have test seeds that we would like to enter using an excel DDT driver.  My question is :  Is there a way to break out of the DDT after one successful addition?  Example:  the first test seed is firstname: AAAA , lastname :BBBB, taxpayerID: xxx-xx-xxxx, if this name is already used go to the next record, if this name has not been used add this record and stop.



Thank you in advance for your help. 

2 Replies

  • NisHera's avatar
    NisHera
    Valued Contributor
    Yes it is possible..

    below is psudo code ...

    you hav to investigated and re-write to work that.



    DDT.ExcelDriver("C:\\........\\Myxl.xlsx","Sheet1",true);

      do


      {


     


        if ((DDT.CurrentDriver.Value('First Name')==myApplication...............fieldFirstName.text)) {


          DDT.CurrentDriver.Next();   


        } else {

              .................................................

              .................................................


             myApplication.................fieldFirstName.setText(DDT.CurrentDriver.Value('FirstName'));


            break;


            }


      }


      while (!(DDT.CurrentDriver.EOF()));


      DDT.CloseDriver(DDT.CurrentDriver.Name);

  • Nishantha,



    Thank you so much for your help.  I had to add a counter in order to 'break' out, but I so appreciate the great start that you posted!



    Thank you!

    LC