コード例 #1
0
        public void PresssKeyOnElementWith(KeyboardActionType keyName, SelectorPathType selector, string path)
        {
            var elementBy = WebElementUtils.GetElementAsBy(selector, path);
            var element   = _driver.FindElement(elementBy);

            KeyboardUtils.EnterKeyToWebElement(element, keyName);
        }
コード例 #2
0
 public KeyboardData GetData(KeyboardActionType type)
 {
     int typeID = (int)type;
     if (!kvDic.ContainsKey(typeID))
     {
         BaseLogger.LogFormat("No such keyboard type: {0}", type);
     }
     return kvDic[typeID];
 }
コード例 #3
0
        public static void EnterKeyToWebElement(IWebElement element, KeyboardActionType keyboardActionType)
        {
            switch (keyboardActionType)
            {
            case KeyboardActionType.ENTER:
                element.SendKeys(Keys.Enter);
                break;

            case KeyboardActionType.ESCAPE:
                element.SendKeys(Keys.Escape);
                break;

            case KeyboardActionType.TAB:
                element.SendKeys(Keys.Tab);
                break;

            default:
                throw new Exception($"Key {keyboardActionType} is not defined in util");
            }
        }
コード例 #4
0
ファイル: InputManager.cs プロジェクト: sigmadruid/NewMaze
 public void SetKeyboardAction(KeyboardActionType type, Action callback)
 {
     int typeID = (int)type;
     if(keyboardActionDic.ContainsKey(typeID))
     {
         KeyboardAction action = keyboardActionDic[typeID];
         action.Callback = callback;
     }
 }