Exemple #1
0
        public string GetInputMappingToServiceValue(int rowNumber)
        {
            var rows = GetInputMappingRows();

            if (rows.Count >= rowNumber)
            {
                UITestControlCollection rowChildren    = rows[rowNumber - 1].GetChildren();
                List <UITestControl>    cells          = rowChildren.Where(c => c.ControlType == ControlType.Cell).ToList();
                UITestControlCollection cellChildren   = cells[1].GetChildren();
                UITestControl           firstOrDefault = cellChildren.FirstOrDefault(c => c.ControlType == ControlType.Text && c.FriendlyName != "*");
                if (firstOrDefault != null)
                {
                    WpfText wpfText = firstOrDefault as WpfText;
                    if (wpfText != null)
                    {
                        return(wpfText.DisplayText);
                    }
                }
            }
            else
            {
                throw new Exception("The row could not be found.");
            }
            return(null);
        }
        protected UITestControl GetQuickVariableInputView()
        {
            UITestControlCollection uiTestControlCollection = Activity.GetChildren();
            UITestControl           firstOrDefault          = uiTestControlCollection.FirstOrDefault(c => ((WpfControl)c).AutomationId == "QuickVariableInputContent");

            if (firstOrDefault != null)
            {
                return(firstOrDefault);
            }
            throw new Exception("Couldnt find the quick variable input view");
        }
        protected UITestControl GetLargeView()
        {
            UITestControlCollection uiTestControlCollection = Activity.GetChildren();
            UITestControl           firstOrDefault          = uiTestControlCollection.FirstOrDefault(c => c.FriendlyName == "LargeViewContent");

            if (firstOrDefault != null)
            {
                return(firstOrDefault);
            }
            throw new Exception("Couldnt find the large view");
        }
Exemple #4
0
        private UITestControl GetTextBox(string autoId, UITestControl viewControl)
        {
            UITestControlCollection uiTestControlCollection = viewControl.GetChildren();
            UITestControl           textbox = uiTestControlCollection.FirstOrDefault(c => c.ControlType == ControlType.Edit && c.FriendlyName == autoId);

            if (textbox != null)
            {
                return(textbox);
            }

            throw new Exception("Couldn't find the" + autoId + " textbox.");
        }
        protected UITestControl GetControl(string autoId, UITestControl viewControl, ControlType controlType)
        {
            UITestControlCollection uiTestControlCollection = viewControl.GetChildren();
            UITestControl           control = uiTestControlCollection.FirstOrDefault(c => ((WpfControl)c).AutomationId.Equals(autoId));

            if (control != null)
            {
                return(control);
            }

            throw new Exception("Couldn't find the " + autoId + " for control type " + controlType);
        }
Exemple #6
0
        UITestControl GetFixErrorsButton()
        {
            UITestControlCollection activityChildren = Activity.GetChildren();
            UITestControl           smallView        = activityChildren.FirstOrDefault(c => c.FriendlyName.Contains("SmallView"));

            if (smallView != null)
            {
                List <UITestControl> buttons = smallView.GetChildren().Where(c => c.ControlType == ControlType.Button).ToList();
                if (buttons.Any())
                {
                    return(buttons[0]);
                }
            }

            return(null);
        }
Exemple #7
0
        public void EnterTextIntoValue(int index, string stringToEnter)
        {
            WpfTable table = GetLargeViewTable();

            if (table == null)
            {
                table = GetSmallViewTable();
            }
            UITestControl           row  = table.Rows[index];
            UITestControl           cell = row.GetChildren()[4];
            UITestControlCollection uiTestControlCollection = cell.GetChildren();
            UITestControl           textbox = uiTestControlCollection.FirstOrDefault(c => c.ControlType == ControlType.Edit);

            if (textbox != null)
            {
                textbox.EnterText(stringToEnter);
            }
        }
Exemple #8
0
        public string GetTextFromValue(int index)
        {
            WpfTable table = GetLargeViewTable();

            if (table == null)
            {
                table = GetSmallViewTable();
            }
            UITestControl           row  = table.Rows[index];
            UITestControl           cell = row.GetChildren()[4];
            UITestControlCollection uiTestControlCollection = cell.GetChildren();
            UITestControl           textbox = uiTestControlCollection.FirstOrDefault(c => c.ControlType == ControlType.Edit);

            if (textbox != null)
            {
                return(textbox.GetText());
            }
            return(null);
        }
        /// <summary>
        /// DoubleClickAFolder
        /// </summary>
        public void DoubleClickFirstWorkflowFolder()
        {
            var localHostExplorerTree = GetLocalHostExplorerTree();

            foreach (var treeChild in localHostExplorerTree.GetChildren())
            {
                var workflowsAutoID = treeChild.GetProperty("AutomationID").ToString();
                if (workflowsAutoID.Contains("WORKFLOW"))
                {
                    UITestControlCollection uiTestControlCollection = treeChild.GetChildren();
                    UITestControl           firstOrDefault          = uiTestControlCollection.FirstOrDefault(c => c.ControlType == ControlType.TreeItem);

                    Mouse.Click(firstOrDefault, new Point(57, 9));
                    Playback.Wait(100);
                    Mouse.DoubleClick(firstOrDefault, new Point(57, 9));
                    return;
                }
            }
            throw new UITestControlNotFoundException("Folder not found");
        }
Exemple #10
0
        public UITestControl AdornersGetButton(string adornerFriendlyName)
        {
            UITestControlCollection testFlowChildCollection = Activity.GetChildren();

            return(testFlowChildCollection.FirstOrDefault(theControl => theControl.FriendlyName == adornerFriendlyName));
        }