Exemplo n.º 1
0
 public static SearchCriteria ByControlType(ControlType controlType)
 {
     return(new SearchCriteria(ConditionFactory.ByControlType(controlType)));
 }
Exemplo 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);
            }
        }
Exemplo n.º 3
0
 public virtual SearchCriteria AndControlType(ControlType controlType)
 {
     _conditions.Insert(0, ConditionFactory.ByControlType(controlType));
     return(this);
 }
Exemplo n.º 4
0
 private AutomationElement GetEditableElement()
 {
     return(FindFirstChild(ConditionFactory.ByControlType(ControlType.Edit)));
 }
Exemplo 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());
 }
Exemplo n.º 6
0
        private Button FindButton(string automationId)
        {
            var buttonElement = FindFirst(TreeScope.Children, ConditionFactory.ByControlType(ControlType.Button).And(ConditionFactory.ByAutomationId(automationId)));

            return(buttonElement.AsButton());
        }
Exemplo 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();
        }
Exemplo 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());
 }
Exemplo n.º 9
0
        private Thumb FindThumb()
        {
            var thumb = FindFirstChild(ConditionFactory.ByControlType(ControlType.Thumb));

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

            return(button.AsButton());
        }