//[BeforeScenario("Protractor")] public static void BeforeWebScenarioProtractor(string browserTypeFromConsole, string urlFromConsole, string authUser, string authPass, string authType) { var brType = browserTypeFromConsole; var urlToRun = urlFromConsole; switch (brType.ToLower()) { case "ie": Driver.StartBrowser(BrowserTypes.ProtractorIE); Driver.Browser.Manage().Window.Maximize(); UnityContainerFactory.GetContainer().RegisterInstance <IWebDriver>(Driver.Browser); UnityContainerFactory.GetContainer().RegisterInstance <NgWebDriver>(Driver.NgDriver); browserType = "IE"; break; case "chrome": Driver.StartBrowser(BrowserTypes.ProtractorChrome); Driver.Browser.Manage().Window.Maximize(); UnityContainerFactory.GetContainer().RegisterInstance <IWebDriver>(Driver.Browser); UnityContainerFactory.GetContainer().RegisterInstance <NgWebDriver>(Driver.NgDriver); browserType = "Chrome"; break; default: break; } //Driver.Browser.Navigate().GoToUrl(urlToRun); //if (authUser != null & authPass != null & authType != null & authUser != string.Empty & authPass != string.Empty & authType != string.Empty) //{ // Authenticate(authUser, authPass, authType); //} }
//[BeforeScenario("Selenium")] public static void BeforeWebScenarioSelenium(string browserTypeFromConsole, string urlFromConsole, string authUser, string authPass, string authType) { var dictionary = DictionaryInteractions.ReadFromPropertiesFile(ReturnPath.ProjectFolderPath() + "ExtentReport/ReportProperties.txt"); DictionaryInteractions.WriteInTxtFileFromDictionary(ReturnPath.ProjectFolderPath() + "ExtentReport/ReportProperties.txt", dictionary, "tfsReportStatus", ""); var brType = browserTypeFromConsole; var urlToRun = urlFromConsole; switch (brType.ToLower()) { case "ie": Driver.StartBrowser(BrowserTypes.InternetExplorer); Driver.Browser.Manage().Window.Maximize(); UnityContainerFactory.GetContainer().RegisterInstance <IWebDriver>(Driver.Browser); browserType = "IE"; break; case "chrome": Driver.StartBrowser(BrowserTypes.Chrome); Driver.Browser.Manage().Window.Maximize(); UnityContainerFactory.GetContainer().RegisterInstance <IWebDriver>(Driver.Browser); browserType = "Chrome"; break; default: break; } //Driver.Browser.Navigate().GoToUrl(urlToRun); //if(authUser !=null & authPass !=null & authType != null) //{ // Authenticate(authUser, authPass, authType); //} }
public ICommanActions ResolveClassTypeToICommanActions(Type classType, string className) { var classInterface = (ICommanActions)UnityContainerFactory.GetContainer().Resolve(classType, className); if (classInterface == null) { exAssert.RecordCantFindErrors(className, "CantResolveInerface"); } return(classInterface); }
public object ResolveClassTypeFromAssemblyByString(Type classType, string className) { var classObject = UnityContainerFactory.GetContainer().Resolve(classType, className); if (classObject == null) { exAssert.RecordCantFindErrors(className, "CantResolveClassType"); } return(classObject); }