Exemple #1
0
        private void GetCurrent()
        {
            var automation      = new UIA3Automation();
            var mainWindow      = pcc.GetMainWindow(automation);
            ConditionFactory cf = new ConditionFactory(new UIA3PropertyLibrary());

            mainWindow.Focus();
            string current = "";

            mainWindow.FindFirstDescendant(cf.ByAutomationId("btnCurrent")).AsButton().Click();
            current = mainWindow.FindFirstDescendant(cf.ByAutomationId("txbCurrent")).AsTextBox().Name;

            mainWindow.FindFirstDescendant(cf.ByAutomationId("btnELVDD")).AsButton().Click();
            string voltage = mainWindow.FindFirstDescendant(cf.ByAutomationId("txbELVDD")).AsTextBox().Name;

            OutputDataGridView.Rows[irow].Cells[5].Value = current;
            OutputDataGridView.Rows[irow].Cells[7].Value = voltage;
        }
Exemple #2
0
        private static Window WaitUntillSlnIsLoaded(FlaUI.Core.Application app, UIA3Automation automation)
        {
            int delayMSeconds = 500;
            var cf            = new ConditionFactory(new UIA3PropertyLibrary());
            AutomationElement debugTargetButton = null;
            Window            mainWindow        = null;

            while (debugTargetButton is null)
            {
                mainWindow = app.GetMainWindow(automation);

                debugTargetButton = mainWindow.FindFirst(FlaUI.Core.Definitions.TreeScope.Descendants, cf.ByName("Debug Target"));

                if (!(debugTargetButton is null))
                {
                    break;
                }

                Task.Delay(delayMSeconds).Wait();
            }
            return(mainWindow);
        }