예제 #1
0
        public void InputText(string Tvalue, string Target, string sType)
        {
            //Deal with Command
            List <string> Itmes = JSupport.ComandParse(ref Tvalue, ref Target, ref sType);

            //Action
            foreach (string item in Itmes)
            {
                switch (item)
                {
                case "@普通文本框":
                    element = JElement.GetInputElement(driver, Tvalue, Target);
                    break;

                case "@文件文本框":
                    element = JElement.GetFileInputElement(driver, Tvalue, Target);
                    break;

                case "@清空":
                    JAction.Clear(element);
                    break;

                case "@搜索":
                    JAction.EnterAction(driver, element);
                    break;

                case "@输入":
                    JAction.SendKeys(element, Tvalue);
                    break;

                default:
                    throw new ArgumentOutOfRangeException(string.Format("✘:sType命令中不存在:{0},请核对", item));
                }
            }
        }