Ask a Question

Data Driven Testing using Excel file and import in to my script multiple times

SOLVED
Urmikhan
Occasional Contributor

Data Driven Testing using Excel file and import in to my script multiple times

Using DDT Driver for test data excel sheet to my script but it is not working .Could you give me the syntax how I iterate multiple test data in to my scripts:

I am using this syntax:

function Test() {
var xlValue = Project.Variables.TestData;
// Initialize the iterator
xlValue.Reset();
// Iterate through rows
while (!xlValue.IsEOF()) {
var input = xlValue.Value("Customer Name");

Log.Message(input);
xlValue.Next();

}
return input;

}

But how I include in to my test and multiple customer name is running.



1 REPLY 1
LinoTadros
Community Hero

This is all you need to reiterate through all the records in the excel worksheet:

function Test()
{
  DDT.ExcelDriver("File path and name", "Sheet name");
  While (!DDT.CurrentDriver.EOF())
  {
    Log.Message(DDT.CurrentDriver.Value("CustomerName"));
    DDT.CurrentDriver.Next();
  }
}

Thanks

-Lino

cancel
Showing results for 
Search instead for 
Did you mean: