Forum Discussion

ryno022604's avatar
ryno022604
Occasional Contributor
14 years ago

DDT Keyword not working...

I am having a little trouble setting up my DDT to work with keyword testing. I followed a tutorial video and set it up in the same manner but it isn't working for me. The only difference I can see is I am using Delphi and he used JScript. My test is setup like this:



Call an Object Method: DDT, CSVDriver, Path to excel sheet.

Program opens and logs in

While Loop with Code Expression, DDT.CurrentDriver.EOF() equal to False

Navigates to add a customer

Enters in information (Account Number, Name, Address...)

Close with another Call to Object Method: DDT.CurrentDriver, Next



The spreadsheet is saved as a CSV file. The test will run fine until the part to add in the information from the spreadsheet. When I try to debug it takes me to the While Loop but I am not sure what is setup wrong. Any help would be greatly appreciated!



Thank you for your time,



Ryan Christensen








6 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Instead of "While DDT.CurrentDriver.EOF = FALSE", try "while not DDT.CurrentDriver.EOF".


  • ryno022604's avatar
    ryno022604
    Occasional Contributor
    Thank you for the suggestion. In the keyword test when I add that expression it gives me and error:

    The "while not DDT.CurrentDriver.EOF()" expression is invalid.



    Any other ideas?
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Here is essentially the code I would write for what you're doing. 





    procedure AddCustomer;



    var

         CustomerCSV;



    begin

    CustomerCSV := DDT.CSVDriver('C:\MyPath\MyCustomers.csv');

    LogIntoApp;

    while not CustomerCSV.EOF do begin

        EnterCustomerInformation(CustomerCSV); //procedure would then use .Value[<ColumnName>] to populate the screen

        CustomerCSV.Next;

        end;

    DDT.CloseDriver(CustomerCSV.Name);

    end;





    So, some questions for you:



    1)  You're using DDT.CurrentDriver.  How are you assigning the driver so that DDT.CurrentDriver works?

    2)  You mention using the CSVDriver but you're talking about an Excel Spreadsheet.  When you create your driver, are you pointing to the CSV file or are you pointing to the xls file?



    It might be helpful to see the actual code you're working with if possible.
  • ryno022604's avatar
    ryno022604
    Occasional Contributor
    The document I am pointing to is an Excel document but it is saved as a CSV file. I tried changing the driver to an Excel driver but it didn't work. I have attached a screen shot of my keyword test. Hopefully this helps a little, I appreciate your help and time.


  • Hi Ryan,


    To help us investigate the problem, please zip your entire project suite folder along with the log of the failed test execution and send us the archive via our Contact Support form . Make sure that messages in your log correspond to the latest version of your tests.

  • ryno022604's avatar
    ryno022604
    Occasional Contributor
    Thank you Allen, I have uploaded this information for you to take a look at. I appreciate your help and time.



    Thanks,

    Ryan