Пример #1
0
        //**************************************************************************************************************************************************************
        public static void UIA_ClickOnPaneItem(AutomationElement uiaWindow, Window window, int index)
        {
            try
            {
                PropertyCondition paneCondition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Pane);
                AutomationElementCollection allPanes = uiaWindow.FindAll(TreeScope.Descendants, paneCondition);

                TestStack.White.UIItems.Panel p = new TestStack.White.UIItems.Panel(allPanes[index], window.ActionListener);
                p.Focus();
                p.Click();
                Thread.Sleep(int.Parse(Execution_Speed));
            }
            catch (Exception e)
            {
                String sMessage = e.Message;
                LastException.SetLastError(sMessage);
                throw new Exception(sMessage);
            }
        }
        //**************************************************************************************************************************************************************


        public static void UIA_ClickOnPaneItem(AutomationElement uiaWindow, Window window, int index)
        {
            Logger.logMessage("Function call @ :" + DateTime.Now);

            try
            {
                PropertyCondition paneCondition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Pane);
                AutomationElementCollection allPanes = uiaWindow.FindAll(TreeScope.Descendants, paneCondition);

                TestStack.White.UIItems.Panel p = new TestStack.White.UIItems.Panel(allPanes[index], window.ActionListener);
                p.Focus();
                p.Click();
                Thread.Sleep(int.Parse(Execution_Speed));
                Logger.logMessage("UIA_ClickOnPaneItem " + uiaWindow + "->" + window + "->" + index + " - Successful");
                Logger.logMessage("------------------------------------------------------------------------------");

            }
            catch (Exception e)
            {
                Logger.logMessage("UIA_ClickOnPaneItem " + uiaWindow + "->" + window + "->" + index + " - Failed");
                Logger.logMessage(e.Message);
                Logger.logMessage("------------------------------------------------------------------------------");
                String sMessage = e.Message;
                LastException.SetLastError(sMessage);
                throw new Exception(sMessage);
            }

        }