public void PerformActions(string keyword, string locatorType, string locatorValue, params string[] parameters) { switch (keyword) { case "Click": ButtonHelper.ClickOnButton(GetElementLocator(locatorType, locatorValue)); break; case "SendKeys": { TextBoxHelper.ClearTextbox(GetElementLocator(locatorType, locatorValue)); TextBoxHelper.TypeInTextbox(GetElementLocator(locatorType, locatorValue), parameters[0]); } break; case "Navigate": NavigationHelper.NavigationToURL(parameters[0]); break; case "Select": DropdownListHelper.SelectElement(GetElementLocator(locatorType, locatorValue), parameters[0]); break; case "WaitForEle": GenericHelpers.WaitForElementInPage(GetElementLocator(locatorType, locatorValue), TimeSpan.FromSeconds(60)); break; default: throw new NoSuchKeywordException("No such keyword found" + keyword); } }
public void CheckDropDownList() { NavigationHelper.NavigationToURL(ObjectRepository.Config.GetWebsite()); LinkHelper.ClickLink(By.LinkText("File a Bug")); Thread.Sleep(100); TextBoxHelper.ClearTextbox(By.Id("Bugzilla_login")); TextBoxHelper.TypeInTextbox(By.Id("Bugzilla_login"), ObjectRepository.Config.GetUsername()); TextBoxHelper.ClearTextbox(By.Id("Bugzilla_password")); TextBoxHelper.TypeInTextbox(By.Id("Bugzilla_password"), ObjectRepository.Config.GetPassword()); ButtonHelper.ClickOnButton(By.Id("log_in")); DropdownListHelper.SelectElement(By.Id("bug_severity"), 2); DropdownListHelper.SelectElement(By.Id("bug_severity"), "minor"); IList <string> getAllOptions = DropdownListHelper.GetAllItems(By.Id("bug_severity")); foreach (string var in getAllOptions) { Console.WriteLine(var); } }
public void SelectDropdownList(string severity = null, string hardware = null, string os = null) { if (severity != null) { DropdownListHelper.SelectElement(severityDropdown, severity); } if (hardware != null) { DropdownListHelper.SelectElement(hardwareDropdown, hardware); } if (os != null) { DropdownListHelper.SelectElement(osDropdown, os); } }