예제 #1
0
 private void Driver()
 {
     try
     {
         string        testCaseStatus = Constants.ResultStatus_Passed;
         StepProcessor stepprocessor  = new StepProcessor();
         stepprocessor.TestStepStatus = new List <string>();
         stepprocessor.TestData       = _Testdata;
         stepprocessor.InstrSheet     = _InstrSheet;
         stepprocessor.TestStartInfo  = _TestStartInfo;
         //ToDo: This is temp solution till we execute from TFS directly.
         stepprocessor.OnTestCaseCompletion += TestCaseCompletion;
         TestSteps teststeps = new TestSteps();
         for (int index = 0; index <= (_InstrSheet.Rows.Count - 1); index++)
         {
             teststeps.Index          = index;
             teststeps.Action         = _InstrSheet.Rows[index][Constants.Column_Actions].ToString().ToUpper().Trim();
             teststeps.DataReference  = _InstrSheet.Rows[index][Constants.Column_Data].ToString().Trim();
             teststeps.Option         = _InstrSheet.Rows[index][Constants.Column_Option].ToString().ToUpper().Trim();
             teststeps.ExpectedResult = _InstrSheet.Rows[index][Constants.Column_ExpectedResult].ToString().ToUpper().Trim();
             stepprocessor.TestStepProcessor(teststeps);
             _InstrSheet.Rows[index][Constants.Column_ActulaResult] = teststeps.ActualResult;
             _InstrSheet.Rows[index][Constants.Column_Status]       = stepprocessor.TestStepStatus.Last();
             _InstrSheet.Rows[index][Constants.Column_Comment]      = MyLogger.Message();
         }
         ComplileResult(_InstrSheet);
     }
     catch (Exception ex)
     {
         if (_TestStartInfo.Driver != null)
         {
             _TestStartInfo.Driver.Quit();
         }
         MyLogger.Log("Exception : [ " + ex.Message + " ]");
         _TestStartInfo.Dispose();
         CreateLog(_TestStartInfo.ResultPath, MyLogger.completeMessage());
     }
 }