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

            //Action
            foreach (string item in Itmes)
            {
                switch (item)
                {
                case "@单击":
                    JAction.Click(element);
                    break;

                case "@JS单击":
                    JAction.ClickJS(driver, element);
                    break;

                case "@右击":
                    JAction.RightClick(driver, element);
                    break;

                case "@双击":
                    JAction.DoubleClick(driver, element);
                    break;

                case "@普通按钮":
                    element = JElement.GetBtnElement(driver, Tvalue, Target);
                    break;

                case "@勾选按钮":
                    element = JElement.GetRadioElement(driver, Tvalue, Target);
                    break;

                case "@树节点按钮":
                    element = JElement.GetTreeNodeElement(driver, Tvalue, Target);
                    break;

                case "@图标按钮":
                    element = JElement.GetIConElement(driver, Tvalue, Target);
                    break;

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