Multiple DDT CSV's one test
We have an application called Job Entry. It takes some of its data from the JobEntryData.csv as shown below.
var csvPath = "C:\\TestData\\JobEntryData.csv"; Driver = DDT.CSVDriver(csvPath); ih.RunInnovationsProgram("JobEntry.exe"); ih.LoginToInnovations("JobEntry","Ocuco",""); while (!Driver.EOF()) { PopulateIDPage(Driver); PopulateFramePage(Driver); PopulateLensesPage(Driver); PopulateRxPage(Driver); PopulateExtrasPage(Driver); //Indexes to next line of data source Driver.Next(); } DDT.CloseDriver(Driver.Name); }
Some of these PopulateXXXXPage() functions are straightforward, but others data will change based on a combo box. In the switch statement below, you can see the FrameSource_xxxxx changes based on a combo box value. Library, Manual, Uncut in this case.
switch (FrameSource) { case "Library" : FrameSource_Library(groupBox); groupBox.ckEdge2.Keys('[Enter]'); break; case "Manual" : FrameSource_Manual(groupBox); groupBox.ckEdge2.Keys('[Enter]'); break; case "Uncut" : FrameSource_Uncut(groupBox); break; }
Which executes a given function, like the FrameSource_Library():
function FrameSource_Library(groupBox) { var csvPath = "C:\\TestData\\FramesPage\\FrameSource_Library.csv"; Driver = DDT.CSVDriver(csvPath); var libraryTracing = Driver.Value(0); var type = Driver.Value(1); var fClass = Driver.Value(2); var dbl = Driver.Value(3); groupBox.cbxSource2.Keys("[Enter]"); groupBox.ISTraceLib2.Keys(libraryTracing + "[Enter]"); groupBox.cbxType2.Keys(type + "[Enter]"); groupBox.cbxClass2.Keys("[Enter]"); }
The problem I'm having is after the original pass and after the driver indexes to the next record. It uses the values from FrameSource_Library.csv and not the JobEntry.csv.
I'm pretty sure it has to do with the value persisting in the driver variable.
Before getting into a solution, is this even a good way to do this? If not, got any suggestions?
I hope this is clearer than mud.
My best guess is this... You have too many CSV connections open. You need to make sure that, when you're finished iterating through a CSV result set, you use DDT.CloseDriver to close the connection. There is a limitation in the database engine for CSV connections that restricts how many connections can be open.
I see, in your code, you have the call... but it's commented out.
Change that line to DDT.CloseDriver(Driver.Name) and that should work. You need to make sure you have the same sort of call for all your DDT drivers so that you're closing the connection when it's no longer needed