예제 #1
0
        public AutomationElement this[Guid tabGuid]
        {
            get
            {
                var tabItem = FindByAutomationId("PropPage_" + tabGuid.ToString("n").ToLower());
                Assert.IsNotNull(tabItem, "Failed to find page");

                AutomationWrapper.DumpElement(tabItem);
                foreach (var p in tabItem.GetSupportedPatterns())
                {
                    Console.WriteLine("Supports {0}", p.ProgrammaticName);
                }

                try
                {
                    tabItem.GetInvokePattern().Invoke();
                }
                catch (InvalidOperationException)
                {
                    AutomationWrapper.DoDefaultAction(tabItem);
                }

                return(FindByAutomationId("PageHostingPanel"));
            }
        }