rmnrdi
7 years agoContributor
Handling errors in DDT
I've created a DDT "framework" that I use to pass data into a test template.
This is the function that controls the whole thing:
// Start Here function Main() { aqPerformance.Start(); //Used as the master test id var csvPath = "C:\\TestData\\JobEntryData\\TestID.csv"; let JEDriver = DDT.CSVDriver(csvPath); var i = 1; ih.RunInnovationsProgram("JobEntry.exe"); ih.LoginToInnovations("JobEntry","Ocuco",""); while (!JEDriver.EOF()) { Log.Message("******************** Test run number " + i + " has Started... ********************************") iv.LoadUIVariables(i); SetUIVariables(); PopulateIDPage(); PopulateFramePage(); PopulateLensesPage(); PopulateRxPage(); PopulateExtrasPage(); //PopulateBlanksPage(); PopulateInvoicePage(); Log.Message("^^^^^^^^^^^^^^^^^^^^^^^^^^^ Test run number " + i + " has finished. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); //Indexes to next line of data sources i++; //Indexes to next line in id file JEDriver.Next(); } DDT.CloseDriver(JEDriver.Name); var testTime = aqConvert.FloatToStr(((aqPerformance.Value()/1000)/60)); Log.Message(aqString.Format("Minutes to complete tests: %.2f", testTime)); }
In each of the "populatexxx" functions are connections to external data csv's as data sources.
Since many tests can be run through this one script, with the data deciding how the UI acts, this is a single point of failure. If I were to make 20 tests, and one failed, I could do a cleanup and start on the next test.
It doesn't seem like I can do that here, because if the test fails, the test loses it's state and reports the error.
How can I handle errors using this technique?
Is my test setup fundementally flawed?
How does one create "individual" tests using DDT?
Thanks