private String InvokeTestScript(SeleniumTestParameters testParameters) { string testStatus; FrameworkParameters frameworkParameters = FrameworkParameters.Instance; if (frameworkParameters.StopExecution) { testStatus = "Test Execution Aborted"; } else { DriverScript driverScript = new DriverScript(testParameters); try { driverScript.DriveTestExecution(); } catch (AssertFailedException ex) { testStatus = "Failed"; } testStatus = driverScript.TestStatus; } return(testStatus); }
private static List <SeleniumTestParameters> GetRunInfo(String sheetName) { ExcelDataAccess runManagerAccess = new ExcelDataAccess(frameworkParameters.RelativePath, "Run Manager"); runManagerAccess.DatasheetName = sheetName; int nTestInstances = runManagerAccess.GetLastRowNum(); List <SeleniumTestParameters> testInstancesToRun = new List <SeleniumTestParameters>(); for (int currentTestInstance = 1; currentTestInstance <= nTestInstances; currentTestInstance++) { String executeFlag = runManagerAccess.GetValue(currentTestInstance, "Execute"); //Manik //string Env = ConfigurationManager.AppSettings["Environment"]; // if (executeFlag.Equals("Yes", StringComparison.CurrentCultureIgnoreCase)) { string currentScenario = runManagerAccess.GetValue(currentTestInstance, "Test_Scenario"); //Manik //string currentScenario = currentScenario1 + Env; //Manik string currentTestcase = runManagerAccess.GetValue(currentTestInstance, "Test_Case"); SeleniumTestParameters testParameters = new SeleniumTestParameters(currentScenario, currentTestcase); testParameters.CurrentTestDescription = runManagerAccess.GetValue(currentTestInstance, "Description"); testParameters.IterationMode = (IterationOptions)Enum.Parse(typeof(IterationOptions), runManagerAccess.GetValue(currentTestInstance, "Iteration_Mode")); String startIteration = runManagerAccess.GetValue(currentTestInstance, "Start_Iteration"); if (!startIteration.Equals("")) { testParameters.StartIteration = Convert.ToInt32(startIteration); } String endIteration = runManagerAccess.GetValue(currentTestInstance, "End_Iteration"); if (!endIteration.Equals("")) { testParameters.EndIteration = Convert.ToInt32(endIteration); } String browser = runManagerAccess.GetValue(currentTestInstance, "Browser"); if (!browser.Equals("")) { testParameters.Browser = (Browser)Enum.Parse(typeof(Browser), browser); } String browserVersion = runManagerAccess.GetValue(currentTestInstance, "Browser_Version"); if (!browserVersion.Equals("")) { testParameters.BrowserVersion = browserVersion; } String platform = runManagerAccess.GetValue(currentTestInstance, "Platform"); if (!platform.Equals("")) { testParameters.Platform = PlatformFactory.GetPlatform(platform); } testInstancesToRun.Add(testParameters); } } return(testInstancesToRun); }
/// <summary> /// Constructor to initialize the details of the test case to be executed /// </summary> /// <param name="testParameters">The TestParameters object (passed from the Allocator)</param> /// <param name="report">The SeleniumReport object (passed from the Allocator)</param> public ParallelRunner(SeleniumTestParameters testParameters, SeleniumReport report) { _testParameters = testParameters; _report = report; }