Beispiel #1
0
        private static WinTabList GetWinTabList(string uiTitle, string uiType)
        {
            var htmlcontrolWin = new WinTabList(Window.Locate(uiTitle, uiType));
            var htmlControlWin = htmlcontrolWin;

            htmlControlWin.TechnologyName = TechnologyNameWin;
            return(htmlControlWin);
        }
        public WinTabPage GetTab(string TabName)
        {
            WinWindow TabWin = new WinWindow(GetMainWindow());
            TabWin.SearchProperties[WinWindow.PropertyNames.ControlId] = "293";
            TabWin.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString()));

            WinTabList TabList = new WinTabList(TabWin);
            TabList.SearchProperties[WinTabList.PropertyNames.Name] = "Tab1";
            TabList.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString()));

            WinTabPage TabToClick = new WinTabPage();

            switch(TabName)
            {
                case "AnalysisReport":
                    {
                        WinTabPage AnalysisReport = new WinTabPage(TabList);
                        AnalysisReport.SearchProperties[WinTabPage.PropertyNames.Name] = "Analysis Report";
                        AnalysisReport.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString()));
                        TabToClick = AnalysisReport;
                        break;
                    }
                case "SurfaceParameters":
                    {
                        WinTabPage SurfaceParameters = new WinTabPage(TabList);
                        SurfaceParameters.SearchProperties[WinTabPage.PropertyNames.Name] = "Surface Parameters";
                        SurfaceParameters.WindowTitles.Add((new PropertyExpression(WinWindow.PropertyNames.Name, "LOWIS:", PropertyExpressionOperator.Contains).ToString()));
                        TabToClick = SurfaceParameters;
                        break;
                    }
            }
            return TabToClick;
        }
 private void FindTabManager()
 {
     _tabManager = new WinTabList(_docCardWindow);
     _tabManager.SearchProperties[WinControl.PropertyNames.ControlName] = "tabManager";
 }
        public bool GetTabExists(string tabName)
        {
            try
            {
                WinWindow parentWindow = new UIAXCWindow();
                WinWindow itemWindow = new WinWindow(parentWindow);
                itemWindow.SearchProperties.Add("Instance", "11");
                itemWindow.SearchProperties.Add("ClassName", "WindowsForms10.Window", PropertyExpressionOperator.Contains);
                itemWindow.WaitForControlReady();
                WinTabList tabList = new WinTabList(itemWindow);
                tabList.SearchProperties.Add("ControlType", "TabList");
                tabList.WaitForControlReady();
                UITestControlCollection tablistChildren = tabList.GetChildren();
                int tabListCount = tablistChildren.Count();
                for (int i = 0; i <= tabListCount; i++)
                {

                    if ((tablistChildren.ElementAt(i).ControlType.ToString() == "TabPage") && (tablistChildren.ElementAt(i).Name == tabName) && !(tablistChildren.ElementAt(i).State.ToString().Contains("Invisible")))
                    {
                        return true;
                    }

                } return false;
            }
            catch
            {
                return false;
            }
        }