shahid24
8 years agoContributor
Data Driven Test, in a new test run, would like to use last value used +1 .
Hi, I am playing a data driven web keyword test which takes input from an excel sheet. Before a new test run, would like to use last value used + 1, as a unique entry is required each time I run the test. I do not wan to each time update the excel sheet.
Please can you let me know how this is possible.
Thank you,
Shahid
I wouldn't do something like try to increment by 1. Instead, add code to put some sort of unique identifier on the values.
var driver = DDT.ExcelDriver('c:\data\myfile.xls', 'mysheet', true);
var uniqueValue = aqConvert.DateTimeToFormatStr(aqDateTime.Now(), '%Y%m%d%H%M'); while (!driver.EOF){ Aliases.MyApp.MyForm.EditField.Keys(driver.Value('firstcolumn') + uniqueValue.); driver.Next(); }That way you can keep using the same spreadsheet over and over and always have unique data. The above is just an example, obviously, depending upon the data and how you are using it, this might need adaptation.