예제 #1
0
        private void PerformAction(string keyword, string locatorType, string locatorValue, params string[] args)
        {
            switch (keyword)
            {
            case "Click":
                ButtonHelper.ClickButton(GetElementLocator(locatorType, locatorValue));
                break;

            case "SendKeys":
                TextBoxHelper.SetText(GetElementLocator(locatorType, locatorValue), args[0]);
                break;

            case "Select":
                DropDownListHelper.SelectListItemByname(GetElementLocator(locatorType, locatorValue), args[0]);
                break;

            case "WaitForEle":
                GenericHelper.CanIWaitForWebelementToAppearInPage(GetElementLocator(locatorType, locatorValue),
                                                                  TimeSpan.FromSeconds(50));
                break;

            case "Navigate":
                NavigationHelper.NavigateToURL(args[0]);
                break;

            default:
                throw new NoKeywordFoundException("Keywrd not found: " + keyword);
            }
        }