public void Action_TransmitTask(string Code) { Buffalo.Core.CodeProcessor.CodeScaner _Obj_Scaner = new CodeProcessor.CodeScaner(); _Obj_Scaner.Action_Scan(Code); Case.BasicTestCase testCase = new Case.BasicTestCase(); testCase.CaseName = ""; testCase.CaseCodeLineCount = _Obj_Scaner.CodePool.Count; string idCase = Guid.NewGuid().ToString(); testCase.CaseID = idCase; if (testCase.CaseName == "") { testCase.CaseName = Guid.NewGuid().ToString(); } testCase.ActiveTestCaseReport = Case.CaseReport.CreateInstance(testCase.CaseName); testCase.SingleInterrupt = false; Thread newThreadFetchMessage = new Thread(new ParameterizedThreadStart(Action_FetchConsoleMessage)); _FetchMessageThreadsPool.Add(newThreadFetchMessage); newThreadFetchMessage.Start(testCase); foreach (int codeIndex in _Obj_Scaner.CodePool.Keys) { Case.CaseContentItem caseContent = Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_CreateContentInstance(); Case.CaseMethodItem caseMethod = Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_CreateMethodInstance(); Case.CaseMethodItem caseSelectMethod = Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_CreateMethodInstance(); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_Case(testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_Connect(testCase, _Obj_WebBrowserDriver, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_WebBrowser(caseMethod, testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_Select(caseSelectMethod, testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_ElementAction(caseMethod, testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_ImportXML(testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_ImportDB(testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_ImportExcel(testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_DataFill(testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_DataSet(testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_FillExistedData(testCase, _Obj_Scaner.CodePool[codeIndex]); if (testCase.SingleInterrupt == true) { return; } } _RunningTaskPool.Enqueue(testCase); }
public void Action_TransmitTask(string Code) { Buffalo.Core.CodeProcessor.CodeScaner _Obj_Scaner = new CodeProcessor.CodeScaner(); _Obj_Scaner.Action_Scan(Code); Case.BasicTestCase testCase = new Case.BasicTestCase(); testCase.CaseName = ""; testCase.CaseCodeLineCount = _Obj_Scaner.CodePool.Count; string idCase = Guid.NewGuid().ToString(); testCase.CaseID = idCase; if (testCase.CaseName == "") testCase.CaseName = Guid.NewGuid().ToString(); testCase.ActiveTestCaseReport = Case.CaseReport.CreateInstance(testCase.CaseName); testCase.SingleInterrupt = false; Thread newThreadFetchMessage = new Thread(new ParameterizedThreadStart(Action_FetchConsoleMessage)); _FetchMessageThreadsPool.Add(newThreadFetchMessage); newThreadFetchMessage.Start(testCase); foreach (int codeIndex in _Obj_Scaner.CodePool.Keys) { Case.CaseContentItem caseContent = Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_CreateContentInstance(); Case.CaseMethodItem caseMethod = Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_CreateMethodInstance(); Case.CaseMethodItem caseSelectMethod = Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_CreateMethodInstance(); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_Case(testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_Connect(testCase, _Obj_WebBrowserDriver, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_WebBrowser(caseMethod, testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_Select(caseSelectMethod, testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_ElementAction(caseMethod, testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_ImportXML(testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_ImportDB(testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_ImportExcel(testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_DataFill(testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_DataSet(testCase, _Obj_Scaner.CodePool[codeIndex]); Core.CodeProcessor.CodeTransmitor.CodeTransmit_Action_FillExistedData(testCase, _Obj_Scaner.CodePool[codeIndex]); if (testCase.SingleInterrupt == true) return; } _RunningTaskPool.Enqueue(testCase); }