Esempio n. 1
0
 public static SearchCriteria ByControlType(ControlType controlType)
 {
     return(new SearchCriteria(ConditionFactory.ByControlType(controlType)));
 }
Esempio n. 2
0
        public void TestConditionFactoryWithMultipleConditions()
        {
            var application     = FlaUI.Core.Application.Launch(@"C:\Data\Visual Studio Workspace\FlaUiPractice\FlaUIPractice\BankSystem\bin\Release\BankSystem.exe");
            var automation      = new UIA3Automation();
            var mainWindow      = application.GetMainWindow(automation);
            ConditionFactory cf = new ConditionFactory(new UIA3PropertyLibrary());

            mainWindow.FindFirstDescendant(cf.ByName("Registration")).AsButton().Click();
            var elements = mainWindow.FindAllDescendants(cf.ByName("First Name :").And(cf.ByControlType(FlaUI.Core.Definitions.ControlType.Edit)));

            foreach (var item in elements)
            {
                item.DrawHighlight();
                Thread.Sleep(500);
            }
        }
Esempio n. 3
0
 public virtual SearchCriteria AndControlType(ControlType controlType)
 {
     _conditions.Insert(0, ConditionFactory.ByControlType(controlType));
     return(this);
 }
Esempio n. 4
0
 private AutomationElement GetEditableElement()
 {
     return(FindFirstChild(ConditionFactory.ByControlType(ControlType.Edit)));
 }
Esempio n. 5
0
 /// <summary>
 /// Gets all the <see cref="TreeItem" /> objects for this <see cref="Tree" />
 /// </summary>
 private TreeItem[] GetTreeItems()
 {
     return(FindAll(TreeScope.Children, ConditionFactory.ByControlType(ControlType.TreeItem))
            .Select(e => e.AsTreeItem()).ToArray());
 }
Esempio n. 6
0
        private Button FindButton(string automationId)
        {
            var buttonElement = FindFirst(TreeScope.Children, ConditionFactory.ByControlType(ControlType.Button).And(ConditionFactory.ByAutomationId(automationId)));

            return(buttonElement.AsButton());
        }
Esempio n. 7
0
        private void EnterCredentialsUsernameAndPassword()
        {
            var errorsTabAE = tabItemAEs[2];

            errorsTabAE.AsTabItem().Select();

            var comboBoxes       = WaitUntilMultipleFound(errorsTabAE, FlaUI.Core.Definitions.TreeScope.Descendants, cf.ByControlType(FlaUI.Core.Definitions.ControlType.ComboBox));
            var cbCredentialType = comboBoxes[1].AsComboBox();

            cbCredentialType.Select(0);

            var textBoxes = WaitUntilAtLeastNFound(errorsTabAE, FlaUI.Core.Definitions.TreeScope.Descendants, cf.ByControlType(FlaUI.Core.Definitions.ControlType.Edit), 2);

            textBoxes[0].AsTextBox().Text = username;
            textBoxes[1].AsTextBox().Text = password;

            var buttons = errorsTabAE.FindAll(FlaUI.Core.Definitions.TreeScope.Descendants, cf.ByControlType(FlaUI.Core.Definitions.ControlType.Button));

            buttons[0].AsButton().Invoke();
        }
Esempio n. 8
0
 /// <summary>
 /// Gets all the <see cref="TreeItem"/> objects for this <see cref="TreeItem"/>
 /// </summary>
 private TreeItem[] GetTreeItems()
 {
     return(FindAll(TreeScope.Children, ConditionFactory.ByControlType(ControlType.TreeItem))
            .Select(e => ElementConversionExtensions.AsTreeItem(e)).ToArray());
 }
Esempio n. 9
0
        private Thumb FindThumb()
        {
            var thumb = FindFirstChild(ConditionFactory.ByControlType(ControlType.Thumb));

            return(thumb.AsThumb());
        }
Esempio n. 10
0
        private Button FindButton(string automationId)
        {
            var button = FindFirstChild(ConditionFactory.ByControlType(ControlType.Button).And(ConditionFactory.ByAutomationId(automationId)));

            return(button.AsButton());
        }