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); }
public void WorkflowDesigner_CodedUI_CopyAndPastingAndDeleteingActivity_CopyPasteAndDeleteWork() { //------------Setup for test-------------------------- RibbonUIMap.CreateNewWorkflow(); UITestControl theTab = TabManagerUIMap.GetActiveTab(); //Find the start point UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start"); Point workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200); ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Assign, workflowPoint1); WorkflowDesignerUIMap.AssignControl_ClickLeftTextboxInRow(theTab, "Assign", 0); SendKeys.SendWait("Hello"); //Get Large View button WorkflowDesignerUIMap.OpenCloseLargeView(ToolType.Assign, theTab); //------------Execute Test--------------------------- SendKeys.SendWait("^c"); SendKeys.SendWait("^v"); //------------Assert Results------------------------- UITestControlCollection allControlsOnDesignSurface = WorkflowDesignerUIMap.GetAllControlsOnDesignSurface(theTab); IEnumerable <UITestControl> uiTestControls = allControlsOnDesignSurface.Where(c => c.Name == "DsfMultiAssignActivity"); Assert.IsTrue(uiTestControls.Count() == 2); SendKeys.SendWait("{DELETE}"); allControlsOnDesignSurface = WorkflowDesignerUIMap.GetAllControlsOnDesignSurface(theTab); uiTestControls = allControlsOnDesignSurface.Where(c => c.Name == "DsfMultiAssignActivity"); Assert.IsTrue(uiTestControls.Count() == 1); }
public List <UITestControl> GetInputMappingRows() { UITestControl table = VisualTreeWalker.GetChildByAutomationIdPath(Activity, "LargeView", "Table"); if (table == null) { return(new List <UITestControl>()); } UITestControlCollection tableChildren = table.GetChildren(); List <UITestControl> rows = tableChildren.Where(c => c.ControlType == ControlType.Row).ToList(); return(rows); }
public void CheckScalarInputOrOuput(int position, Dev2MappingType mappingType) { UITestControlCollection variableList = GetScalarVariableList(); UITestControlCollection collection = variableList[position].GetChildren(); List <UITestControl> theBoxs = collection.Where(c => c.ControlType == ControlType.CheckBox).ToList(); if (mappingType == Dev2MappingType.Input) { theBoxs[0].Check(!theBoxs[0].IsChecked()); } else { theBoxs[1].Check(!theBoxs[1].IsChecked()); } }
private UITestControlCollection GetWorkflowNotSavedButtons(string windowTitle = "Workflow not saved...") { // Workflow not saved... UITestControl theWindow = new UITestControl(); theWindow.TechnologyName = "MSAA"; theWindow.SearchProperties["Name"] = windowTitle; theWindow.SearchProperties["ControlType"] = "Window"; theWindow.Find(); UITestControlCollection firstChildren = theWindow.GetChildren(); var ctrls = firstChildren.Where(c => c.ClassName == "Uia.Button"); UITestControlCollection saveDialogButtons = new UITestControlCollection(); foreach (UITestControl control in ctrls) { saveDialogButtons.Add(control); } return(saveDialogButtons); }