public void Setup() { System.Console.Write("Scenarios Setup.\r\n"); var appSettings = ConfigurationManager.AppSettings; string[] browsers = appSettings["Browsers"].Split(';'); var pages = new ConcurrentStack <ISearchPage>(); foreach (string browser in browsers) { if (browser == "Chrome") { Parallel.Invoke(() => pages.Push(new SearchPage <ChromeGrid>())); } if (browser == "Firefox") { Parallel.Invoke(() => pages.Push(new SearchPage <FireFoxGrid>())); } if (browser == "IE") { Parallel.Invoke(() => pages.Push(new SearchPage <InternetExplorerGrid>())); } } var parallelPage = new ParallelModel <ISearchPage>(pages.ToArray()); _page = parallelPage.Cast(); }
public void SetUp() { var appSettings = ConfigurationManager.AppSettings; string[] browsers = appSettings["Browsers"].Split(';'); var pages = new ConcurrentStack <IContactUpPage>(); foreach (string browser in browsers) { if (browser == "Chrome") { Parallel.Invoke(() => pages.Push(new ContactUsPage <ChromeGrid>())); } if (browser == "Firefox") { Parallel.Invoke(() => pages.Push(new ContactUsPage <FireFoxGrid>())); } if (browser == "IE") { Parallel.Invoke(() => pages.Push(new ContactUsPage <InternetExplorerGrid>())); } } var parallelPage = new ParallelModel <IContactUpPage>(pages.ToArray()); _page = parallelPage.Cast(); }