// Previous Method with dictionary /* private void ExecuteTestcase(List<String> businessFlowData) * { * Dictionary<String, int> keywordDirectory = new Dictionary<String, int>(); * * for (int currentKeywordNum = 0; currentKeywordNum < businessFlowData.Count(); currentKeywordNum++) * { * String[] currentFlowData = businessFlowData[currentKeywordNum].Split(",".ToCharArray()); * String currentKeyword = currentFlowData[0]; * * int nKeywordIterations; * if (currentFlowData.Length > 1) * { * nKeywordIterations = Convert.ToInt32(currentFlowData[1]); * } * else * { * nKeywordIterations = 1; * } * * for (int currentKeywordIteration = 0; currentKeywordIteration < nKeywordIterations; currentKeywordIteration++) * { * if (keywordDirectory.ContainsKey(currentKeyword)) * { * keywordDirectory.Add(currentKeyword, keywordDirectory[currentKeyword] + 1); * } * else * { * keywordDirectory.Add(currentKeyword, 1); * } * _currentSubIteration = keywordDirectory[currentKeyword]; * * dataTable.SetCurrentRow(testParameters.CurrentTestcase, _currentIteration, _currentSubIteration); * * if (_currentSubIteration > 1) * { * report.AddTestLogSubSection(currentKeyword + " (Sub-Iteration: " + _currentSubIteration + ")"); * } * else * { * report.AddTestLogSubSection(currentKeyword); * } * * // check the quite status of driver * bool f = CRAFT.SupportLibraries.WebDriverFactory.driverquitstatus; * if (f == true) * { * InvokeBusinessComponent(currentKeyword); * } * * } * } * }*/ // Updated Method with List private void ExecuteTestcase(List <String> businessFlowData) { var keywordList = new List <string>(); for (int currentKeywordNum = 0; currentKeywordNum < businessFlowData.Count(); currentKeywordNum++) { var isIterate = false; String[] currentFlowData = businessFlowData[currentKeywordNum].Split(",".ToCharArray()); String currentKeyword = currentFlowData[0]; int nKeywordIterations; if (currentFlowData.Length > 1) { nKeywordIterations = Convert.ToInt32(currentFlowData[1]); } else { nKeywordIterations = 1; } for (int currentKeywordIteration = 0; currentKeywordIteration < nKeywordIterations; currentKeywordIteration++) { keywordList.Add(currentKeyword); _currentSubIteration = 1; dataTable.SetCurrentRow(testParameters.CurrentTestcase, _currentIteration, _currentSubIteration); report.AddTestLogSubSection(currentKeyword); // check the quite status of driver bool f = CRAFT.SupportLibraries.WebDriverFactory.driverquitstatus; if (f == true) { InvokeBusinessComponent(currentKeyword); } } } }
private void ExecuteTestcase(List <String> businessFlowData) { Dictionary <String, Int32> keywordDirectory = new Dictionary <String, Int32>(); for (int currentKeywordNum = 0; currentKeywordNum < businessFlowData.Count(); currentKeywordNum++) { String[] currentFlowData = businessFlowData[currentKeywordNum].Split(",".ToCharArray()); String currentKeyword = currentFlowData[0]; int nKeywordIterations; if (currentFlowData.Length > 1) { nKeywordIterations = Convert.ToInt32(currentFlowData[1]); } else { nKeywordIterations = 1; } for (int currentKeywordIteration = 0; currentKeywordIteration < nKeywordIterations; currentKeywordIteration++) { if (keywordDirectory.ContainsKey(currentKeyword)) { keywordDirectory[currentKeyword] = keywordDirectory[currentKeyword] + 1; } else { keywordDirectory.Add(currentKeyword, 1); } _currentSubIteration = keywordDirectory[currentKeyword]; _dataTable.SetCurrentRow(TestParameters.CurrentTestcase, _currentIteration, _currentSubIteration); if (_currentSubIteration > 1) { _report.AddTestLogSubSection(currentKeyword + " (Sub-Iteration: " + _currentSubIteration + ")"); } else { _report.AddTestLogSubSection(currentKeyword); } InvokeBusinessComponent(currentKeyword); } } }