示例#1
0
        /// <summary>
        /// Drags a control from the Toolbox to the Workflow
        /// </summary>
        /// <param name="toolName">The name of the control you to drag - Eg: Assign, Calculate, Etc</param>
        /// <param name="tabToDropOnto">The tab on which to drop the control</param>
        /// <param name="pointToDragTo">The point you wish to drop the control</param>
        /// <param name="getDroppedActivity">Get and return the dropped control</param>
        public UITestControl DragControlToWorkflowDesigner(ToolType tool, UITestControl tabToDropOnto, Point pointToDragTo = new Point(), bool getDroppedActivity = true)
        {
            UITestControl theControl = FindToolboxItemByAutomationId(tool);
            theControl.WaitForControlEnabled();
            if(pointToDragTo.X == 0 && pointToDragTo.Y == 0)
            {
                UITestControl theStartButton = WorkflowDesignerUIMap.FindStartNode(tabToDropOnto);
                pointToDragTo = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200);
            }

            Mouse.StartDragging(theControl, MouseButtons.Left);
            Playback.Wait(20);
            Mouse.StopDragging(pointToDragTo);
            Playback.Wait(100);

            UITestControl resourceOnDesignSurface = null;
            if(getDroppedActivity)
            {
                resourceOnDesignSurface = WorkflowDesignerUIMap.FindControlByAutomationId(tabToDropOnto, tool.ToString());
                int counter = 0;
                while(resourceOnDesignSurface == null && counter < 5)
                {
                    Playback.Wait(1000);
                    resourceOnDesignSurface = WorkflowDesignerUIMap.FindControlByAutomationId(tabToDropOnto, tool.ToString());
                    Playback.Wait(500);
                    counter++;
                }
            }

            return resourceOnDesignSurface;
        }
        public void PinPane()
        {
            // Find the explorer main window
            UITestControl anItem = this.UIBusinessDesignStudioWindow;
            anItem.Find();

            // Find the explorer sub window
            UITestControl DocManager = new UITestControl(anItem);
            DocManager.SearchProperties["AutomationId"] = "UI_DocManager_AutoID";
            DocManager.Find();

            // Find the left pane window
            UITestControl DockLeft = new UITestControl(DocManager);
            DockLeft.SearchProperties["AutomationId"] = "DockLeft";
            DockLeft.Find();

            // Find the tab page window
            UITestControlCollection dockLeftChildren = DockLeft.GetChildren()[0].GetChildren();
            //var TabPage = dockLeftChildren.FirstOrDefault(c => c.FriendlyName == "Explorer");
            var TabPage = dockLeftChildren[0];

            // Find the explorer sub window
            UITestControl ExplorerPane = new UITestControl(TabPage);
            ExplorerPane.SearchProperties["AutomationId"] = "UI_ExplorerPane_AutoID";
            ExplorerPane.Find();
            ExplorerPane.DrawHighlight();

            // Find the pin
            UITestControlCollection explorerChildren = ExplorerPane.GetChildren();
            var unpinControl = explorerChildren.First(c => c.FriendlyName == "unpinBtn");
            Mouse.Click(unpinControl);
        }
示例#3
0
 //method to click on button in any window
 // Provide window instance as 1st parameter and button name as 2nd parameter
 //public static void ClickOnButton(UITestControl windowInstence, string butName)
 //{
 //    var group = windowInstence.Container.SearchFor<WinGroup>(new { Name = "" });
 //    var btnControl = group.Container.SearchFor<WinButton>(new { Name = butName });
 //    var btnControlcollection = Actions.GetControlCollection(btnControl);
 //    foreach (var control in btnControlcollection)
 //    {
 //        //MouseActions.Click(control);
 //        control.SetFocus();
 //        SendKeys.SendWait("{ENTER}");
 //    }
 //}
 public static void ClickOnButton(UITestControl windowInstence, string butName)
 {
     var winGroup = windowInstence.Container.SearchFor<WinGroup>(new { Name = "" });
     var btnControl = winGroup.Container.SearchFor<WinButton>(new { Name = butName });
     btnControl.SetFocus();
     MouseActions.Click(btnControl);
 }
示例#4
0
 public static UITestControl GetWindowChild(UITestControl control, string controlName)
 {
     return CodedUIExtension.SearchFor<WinWindow>(control.Container, new
     {
         ControlName = controlName
     }).GetChildren()[3];
 }
示例#5
0
        public void GenerateUIMap()
        {
            string baseUIMapFileName = @"C:\Users\yingzhu.SAGESGROUP\Documents\Visual Studio 2010\Projects\TestSln\CalenderDemo";
            string uimapFileName = System.IO.Path.Combine(baseUIMapFileName, "DownloadPerformanceWindow.uitest");

            UITest uiTest = UITest.Create(uimapFileName);
            UIMap newMap = new UIMap();
            newMap.Id = "UIMap";
            uiTest.Maps.Add(newMap);
            UITestControl root;
            string launchAppFileName = System.Configuration.ConfigurationManager.AppSettings["LaunchAppFileName"];
            if (!string.IsNullOrEmpty(launchAppFileName))
            {
                root = ApplicationUnderTest.Launch(System.Configuration.ConfigurationManager.AppSettings["LaunchAppFileName"]);
            }
            else
            {
                root = new UITestControl();
                root.TechnologyName = "MSAA";
                root.SearchProperties[WinWindow.PropertyNames.Name] = "Download Performance";
                root.SearchProperties[WinWindow.PropertyNames.ControlName] = "DownloadPerformanceDialog";
                root.WindowTitles.Add("Download Performance");
            }
            GetAllChildren(root, uiTest.Maps[0]);
            uiTest.Save(uimapFileName);
        }
 public UIEllisTitleBar(UITestControl searchLimitContainer)
     : base(searchLimitContainer)
 {
     #region Search Criteria
     WindowTitles.Add(Window.Name);
     #endregion
 }
示例#7
0
 public static UITestControl GetWindowProperties(UITestControl container, string windowName)
 {
     return CodedUIExtension.SearchFor<WinWindow>(container.Container, new
     {
         Name = windowName
     });
 }
示例#8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ControlBase"/> class.
        /// </summary>
        /// <param name="sourceControl">The source control.</param>
        protected ControlBase(UITestControl sourceControl)
        {
            if (sourceControl == null)
                throw new ArgumentNullException("sourceControl");

            this.sourceControl = sourceControl;
        }
示例#9
0
        public void LoginUserAndShowHomeOld()
        {
            // Entsprechenden Testdatensatz generieren
            var user = new User("eric", "password");

            // Login-Elemente suchen udn füllen
            var usrTxtBox = new UITestControl();
            var pwTxtBox = new UITestControl();
            var btn = new UITestControl();

            // searchproperties hinzufügen und element suchen
            usrTxtBox.SearchProperties.Add("AutomationId", "username",PropertyExpressionOperator.EqualTo);
            usrTxtBox = usrTxtBox.FindMatchingControls()[0];

            // searchproperties hinzufügen und element suchen
            pwTxtBox.SearchProperties.Add("AutomationId", "password", PropertyExpressionOperator.EqualTo);
            pwTxtBox = pwTxtBox.FindMatchingControls()[0];

            // searchproperties hinzufügen und element suchen
            btn.SearchProperties.Add("AutomationId", "loginbtn", PropertyExpressionOperator.EqualTo);
            btn = btn.FindMatchingControls()[0];

            // Setze entsprechende Werte
            usrTxtBox.SetProperty("Text", user.Name);
            pwTxtBox.SetProperty("Text", user.Password);

            // LoginButton Clicken
            Mouse.Click(btn);

            // Die Willkommen-Message suchen und entsprechend verifizieren
            var welcomemsg = new UITestControl();
            welcomemsg.SearchProperties.Add("AutomationId", "welcomemsg", PropertyExpressionOperator.EqualTo);

            StringAssert.Contains(welcomemsg.GetProperty("Text").ToString(), "Willkommen, eric");
        }
        public void LargeViewTextboxesEnterTestData(ToolType tool, UITestControl theTab)
        {
            //Find the start point
            UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start");
            Point workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200);

            // Drag the tool onto the workflow               
            ToolboxUIMap.DragControlToWorkflowDesigner(tool, workflowPoint1);

            WorkflowDesignerUIMap.OpenCloseLargeView(tool, theTab);

            // Add the data!


            List<UITestControl> listOfTextboxes = GetAllTextBoxesFromLargeView(tool.ToString(), theTab);

            int counter = 0;
            foreach(var textbox in listOfTextboxes)
            {
                WpfEdit tb = textbox as WpfEdit;
                if(tb != null && !tb.IsPassword)
                {
                    tb.SetFocus();
                    SendKeys.SendWait("[[theVar" + counter.ToString(CultureInfo.InvariantCulture) + "]]");
                }

                counter++;
            }
        }
 public void ChooseSourceServerWithKeyboard(UITestControl theTab, string serverName)
 {
     UITestControl sourceServerList = GetSourceServerList(theTab);
     Mouse.Click(sourceServerList);
     Keyboard.SendKeys("{DOWN}{ENTER}");
     Playback.Wait(2000);
 }
 public UITestControl getControl(string tabName, string buttonText)
 {
     UITestControl returnControl = new UITestControl();
     WpfTabList uIRibbonTabList = this.UIBusinessDesignStudioWindow.UIRibbonTabList;
     //int tabCount = uIRibbonTabList.Tabs.Count;
     foreach (WpfTabPage buttonList in uIRibbonTabList.Tabs)
     {
         if (buttonList.FriendlyName == tabName)
         {
             UITestControlCollection buttonListChildren = buttonList.GetChildren();
             foreach (UITestControl buttonGroup in buttonListChildren)
             {
                 foreach (var potentialButton in buttonGroup.GetChildren())
                 {
                     if (potentialButton.GetChildren().Count > 0)
                     {
                         UITestControlCollection buttonProperties = potentialButton.GetChildren();
                         string friendlyName = buttonProperties[0].FriendlyName;
                         if (friendlyName == buttonText)
                         {
                             return (UITestControl)buttonProperties[0];
                         }
                     }
                 }
             }
         }
     }
     return null;
 }
 public static WinRow SelectRowFromTable(UITestControl windowProperties, string tableName, string rowName)
 {
     var table = (WinTable)Actions.GetWindowChild(windowProperties, tableName);
     var row = table.Container.SearchFor<WinRow>(new { Name = rowName });
     row.SetFocus();
     return row;
 }
示例#14
0
 public void ChooseDestinationServerWithKeyboard(UITestControl theTab, string serverName)
 {
     UITestControl destinationServerList = GetDestinationServerList(theTab);
     Mouse.Click(destinationServerList);
     Keyboard.SendKeys("{UP}{ENTER}");
     Playback.Wait(2000);
 }
 public UIContextMenu(UITestControl searchLimitContainer) : 
         base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[WinMenu.PropertyNames.Name] = "Контекст";
     #endregion
 }
示例#16
0
        public bool Adorner_ClickFixErrors(UITestControl theTab, string controlAutomationId)
        {
            UITestControl aControl = FindControlByAutomationId(theTab, controlAutomationId);
            UITestControlCollection testFlowChildCollection = aControl.GetChildren();
            if(testFlowChildCollection.Count > 0)
            {
                foreach(UITestControl theControl in testFlowChildCollection)
                {
                    if(theControl.GetProperty("AutomationID").ToString() == "SmallViewContent")
                    {
                        var smallViewControls = theControl.GetChildren();
                        foreach(var smallViewControl in smallViewControls)
                        {
                            if(smallViewControl.ControlType == ControlType.Button && smallViewControl.Height == 22)
                            {
                                Point newPoint = new Point(smallViewControl.Left + 10, smallViewControl.Top + 10);
                                Mouse.Click(newPoint);
                            }

                        }
                    }
                }
            }
            else
            {
                return false;
            }
            return true;
        }
示例#17
0
 private static void SelectAnInvoiceNumberFromGrid(UITestControl prop)
 {
     var row = TableActions.SelectRowFromTable(prop, ARControls.UnpaidInvoiceGrid,
         "CollectionInvoiceSummaryDomain row 1");
     var cell = row.Container.SearchFor<WinCell>(new {Value = "False"});
     Mouse.Click(cell);
 }
        public static bool OpenRecordFromTable(UITestControl windowInstence, string tableControlName, string columnName, string JoNumber)
        {
            
            var tableName = Actions.GetWindowChild(windowInstence, tableControlName);
            var table = (WinTable)tableName;
            
            foreach (var rowC in table.Rows)
            {
                rowC.SetFocus();
                var rowHeader = table.Container.SearchFor<WinCell>(new { Name = columnName });
                var callValue = rowHeader.GetProperty("Value").ToString();

                if (callValue == JoNumber)
                {
                    Mouse.Click(rowHeader);
                    Mouse.DoubleClick(rowHeader);
                    break;
                }

            }

            var row = table.Container.SearchFor<WinRow>(new { Name = "DispatchJobOrderDetailSummary row 1" });
            var cell = row.Container.SearchFor<WinCell>(new { Name = "Job Order #" });
            Globals.JobOrderNo = cell.Value;
            Mouse.DoubleClick(cell);

            var profileWindow = JobOrderProfileWindowProperties();
            return profileWindow.Exists;
        }
示例#19
0
 public UIItemWindow(UITestControl searchLimitContainer)
     : base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[WinWindow.PropertyNames.ControlId] = "12300";
     #endregion
 }
示例#20
0
 public void CloseDebugWindow_ByCancel()
 {
     WpfWindow debugWindow = GetDebugWindow();
     UITestControl theControl = new UITestControl(debugWindow);
     theControl.SearchProperties.Add("AutomationId", "UI_Cancelbtn_AutoID");
     theControl.Find();
     Mouse.Click(theControl, new Point(5, 5));
 }
        public static UITestControlCollection GetButtonColloction(UITestControl windowInstence, string butName)
        {
            var group = windowInstence.Container.SearchFor<WinGroup>(new { Name = "" });
            var btnControl = group.Container.SearchFor<WinButton>(new { Name = butName });
            var btnControlcollection = Actions.GetControlCollection(btnControl);

            return btnControlcollection;
        }
示例#22
0
 private void GetAllChildren(UITestControl root, UIMap uiMap)
 {
     foreach (UITestControl child in root.GetChildren())
     {
         uiMap.AddUIObject(child.GetProperty(UITestControl.PropertyNames.UITechnologyElement) as IUITechnologyElement);
         GetAllChildren(child, uiMap);
     }
 }
 protected ActivityUiMapBase(bool createNewtab = true, int waitAmt = 1000)
 {
     if(createNewtab)
     {
         Playback.Wait(waitAmt);
         _theTab = RibbonUIMap.CreateNewWorkflow(waitAmt);
     }
 }
 public UIItemWindow(UITestControl searchLimitContainer)
     : base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[WinWindow.PropertyNames.ControlId] = "12295";
     this.WindowTitles.Add("‪CRM outbound message queue‬ (‎‪1‬ - ‎‪rtb‬)‎");
     #endregion
 }
 public UIItemWindow(UITestControl searchLimitContainer)
     : base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[WinWindow.PropertyNames.ControlId] = "12297";
     this.WindowTitles.Add("‪Microsoft Dynamics AX‬ (‎‪1‬)‎");
     #endregion
 }
 private UITestControl GetIE()
 {
     UITestControl ie = new UITestControl();
     ie.SearchProperties[UITestControl.PropertyNames.ClassName] = "IEFrame";
     ie.SearchProperties[UITestControl.PropertyNames.ControlType] = "Window";
     ie.TechnologyName = "MSAA";
     ie.Find();
     return ie;
 }
        public void SelectServers(UITestControl theTab, string sourceServer, string destinationServer)
        {

            // Choose the source server
            ChooseSourceServer(theTab, sourceServer);

            // Choose the destination server
            ChooseDestinationServer(theTab, destinationServer);
        }
 private UITestControl GetUpdateButton()
 {
     UITestControl theControl = this.UIBusinessDesignStudioWindow.UIItemCustom;
     theControl.Find();
     UITestControl updateButton = new UITestControl(theControl);
     updateButton.SearchProperties[WpfTree.PropertyNames.AutomationId] = "UI_AddRemovebtn_AutoID";
     updateButton.Find();
     return updateButton;
 }
        public UICustomerCustomeTitleBar(UITestControl searchLimitContainer)
            : base(searchLimitContainer)
        {
            #region Search Criteria

            WindowTitles.Add(Globals.CustomerName + " - Customer Profile");

            #endregion
        }
 public UIStartPageCustom(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[UITestControl.PropertyNames.ClassName] = "Uia.ContentPane";
     this.SearchProperties["AutomationId"] = "splurt";
     this.WindowTitles.Add(TestBase.GetStudioWindowName());
     #endregion
 }
示例#31
0
 public HeaderResults(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[HtmlDiv.PropertyNames.Id]        = "cbelm";
     this.SearchProperties[HtmlDiv.PropertyNames.Name]      = null;
     this.FilterProperties[HtmlDiv.PropertyNames.InnerText] = "\r\n                        Especificar\r\n\r\n                        másFormatoFormat" +
                                                              "o\r\n\r\n                        T\r\n                      ";
     this.FilterProperties[HtmlDiv.PropertyNames.Title]             = null;
     this.FilterProperties[HtmlDiv.PropertyNames.Class]             = "cb clearfix";
     this.FilterProperties[HtmlDiv.PropertyNames.ControlDefinition] = "class=\"cb clearfix\" id=\"cbelm\" _sp=\"p2045573.m1686\"";
     this.FilterProperties[HtmlDiv.PropertyNames.TagInstance]       = "45";
     this.WindowTitles.Add("PUMA in Fashion | eBay");
     #endregion
 }
示例#32
0
 public ContainerOrderBy(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[HtmlDiv.PropertyNames.Id]                = "DashSortByContainer";
     this.SearchProperties[HtmlDiv.PropertyNames.Name]              = null;
     this.FilterProperties[HtmlDiv.PropertyNames.InnerText]         = "Ordenar por: Mejor resultado \r\n\r\nMejor r";
     this.FilterProperties[HtmlDiv.PropertyNames.Title]             = null;
     this.FilterProperties[HtmlDiv.PropertyNames.Class]             = "cbl dropdownmenu";
     this.FilterProperties[HtmlDiv.PropertyNames.ControlDefinition] = "class=\"cbl dropdownmenu\" id=\"DashSortByContainer\" _sp=\"p2045573.m1686.l5869\" an=\"" +
                                                                      "Dash.SortBy.hover\"";
     this.FilterProperties[HtmlDiv.PropertyNames.TagInstance] = "50";
     this.WindowTitles.Add("PUMA in Fashion | eBay");
     #endregion
 }
示例#33
0
        private static BrowserWindow FindBrowserWindow(UITestControl control)
        {
            while (control != null)
            {
                var browserWindow = control as BrowserWindow;
                if (browserWindow != null)
                {
                    return(browserWindow);
                }

                control = control.GetParent();
            }

            return(null);
        }
示例#34
0
 public Body(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[HtmlDocument.PropertyNames.Id] = null;
     this.SearchProperties[HtmlDocument.PropertyNames.RedirectingPage] = "False";
     this.SearchProperties[HtmlDocument.PropertyNames.FrameDocument]   = "False";
     this.FilterProperties[HtmlDocument.PropertyNames.Title]           = "PUMA in Fashion | eBay";
     this.FilterProperties[HtmlDocument.PropertyNames.AbsolutePath]    = "/sch/i.html";
     this.FilterProperties[HtmlDocument.PropertyNames.PageUrl]         = "https://www.ebay.com/sch/i.html?_nkw=PUMA&_in_kw=1&_ex_kw=&_sacat=11450&_udlo=&_u" +
                                                                         "dhi=&_ftrt=901&_ftrv=1&_sabdlo=&_sabdhi=&_samilow=&_samihi=&_sadis=15&_stpos=&_s" +
                                                                         "argn=-1%26saslc%3D1&_salic=1&_sop=12&_dmd=1&_ipg=50&_fosrp=1";
     this.WindowTitles.Add("PUMA in Fashion | eBay");
     #endregion
 }
示例#35
0
 public UIItemTable(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[HtmlTable.PropertyNames.Id]                = null;
     this.SearchProperties[HtmlTable.PropertyNames.Name]              = null;
     this.FilterProperties[HtmlTable.PropertyNames.InnerText]         = "Event \r\n\r\nLocation \r\n\r\nEventInfo \r\n\r\nTim";
     this.FilterProperties[HtmlTable.PropertyNames.ControlDefinition] = "class=\"table\"";
     this.FilterProperties[HtmlTable.PropertyNames.RowCount]          = "2";
     this.FilterProperties[HtmlTable.PropertyNames.ColumnCount]       = "5";
     this.FilterProperties[HtmlTable.PropertyNames.Class]             = "table";
     this.FilterProperties[HtmlTable.PropertyNames.TagInstance]       = "1";
     this.WindowTitles.Add("Events - TrailMix");
     #endregion
 }
        private WpfButton GetQuickVariableInputButton(UITestControl theTab, string controlAutomationId)
        {
            UITestControl           aControl         = FindControlByAutomationId(theTab, controlAutomationId);
            WpfButton               controlButtons   = new WpfButton(aControl);
            UITestControlCollection buttonCollection = controlButtons.FindMatchingControls();

            foreach (WpfButton theButton in buttonCollection)
            {
                if (theButton.AutomationId.Contains("QuickVariableAddBtn_AutoID"))
                {
                    return(theButton);
                }
            }
            throw new Exception("Error - The Quick Variable Input button could not be located!");
        }
        public static T FindById <T>(this UITestControl control, string controlId) where T : HtmlControl, new()
        {
            var allResult = FindAll <T>(control, new SearchSelector()
            {
                ID = controlId
            });
            T resultControl = default(T);

            if (allResult.Any())
            {
                resultControl = allResult[0];
            }

            return(resultControl);
        }
示例#38
0
 public UIS2id_ContentIDPane(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region 搜尋準則
     this.SearchProperties[HtmlDiv.PropertyNames.Id]                = "s2id_ContentID";
     this.SearchProperties[HtmlDiv.PropertyNames.Name]              = null;
     this.FilterProperties[HtmlDiv.PropertyNames.InnerText]         = null;
     this.FilterProperties[HtmlDiv.PropertyNames.Title]             = null;
     this.FilterProperties[HtmlDiv.PropertyNames.Class]             = "select2-container select2-allowclear select2";
     this.FilterProperties[HtmlDiv.PropertyNames.ControlDefinition] = "class=\"select2-container select2-allowclear select2\" id=\"s2id_ContentID\" style=\"w" +
                                                                      "idth: 100%;\"";
     this.FilterProperties[HtmlDiv.PropertyNames.TagInstance] = "52";
     this.WindowTitles.Add("簽核流程範本管理-新增");
     #endregion
 }
示例#39
0
        public void CheckItemCbx(UITestControl parent, string name)
        {
            var cbx = new HtmlCheckBox(parent);

            cbx.SearchProperties.Add(HtmlHyperlink.PropertyNames.Name, name);

            if (cbx.Checked == false)
            {
                cbx.Checked = true;
            }
            else
            {
                cbx.Checked = false;
            }
        }
示例#40
0
 public RefreshButton(UITestControl searchLimitContainer)
     : base(searchLimitContainer)
 {
     #region Search Criteria
     SearchProperties[HtmlButton.PropertyNames.Id]                = "refreshButton";
     SearchProperties[HtmlButton.PropertyNames.Name]              = null;
     SearchProperties[HtmlButton.PropertyNames.DisplayText]       = " Refresh ";
     SearchProperties[HtmlButton.PropertyNames.Type]              = "button";
     FilterProperties[HtmlButton.PropertyNames.Title]             = "Refresh";
     FilterProperties[HtmlButton.PropertyNames.Class]             = "k-button ama-button k-button-icontext";
     FilterProperties[HtmlButton.PropertyNames.ControlDefinition] = "tabindex=\"0\" title=\"Refresh\" class=\"k-bu";
     FilterProperties[HtmlButton.PropertyNames.TagInstance]       = "3";
     WindowTitles.Add("Microsoft Dynamics 365");
     #endregion
 }
        public static TControl Find <TControl>(this UITestControl container,
                                               PropertyExpressionCollection searchProperties,
                                               PropertyExpressionCollection filterProperties = null) where TControl : HtmlControl, new()
        {
            var control = new TControl {
                Container = container
            };

            control.SearchProperties.AddRange(searchProperties);
            if (filterProperties != null)
            {
                control.FilterProperties.AddRange(filterProperties);
            }
            return(control);
        }
示例#42
0
 public UIHiCIVICButton(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[HtmlButton.PropertyNames.Id]                = "welcome-menu";
     this.SearchProperties[HtmlButton.PropertyNames.Name]              = null;
     this.SearchProperties[HtmlButton.PropertyNames.DisplayText]       = " Hi CIVIC  ";
     this.SearchProperties[HtmlButton.PropertyNames.Type]              = "button";
     this.FilterProperties[HtmlButton.PropertyNames.Title]             = null;
     this.FilterProperties[HtmlButton.PropertyNames.Class]             = "btn btn-default dropdown-toggle";
     this.FilterProperties[HtmlButton.PropertyNames.ControlDefinition] = "class=\"btn btn-default dropdown-toggle\" ";
     this.FilterProperties[HtmlButton.PropertyNames.TagInstance]       = "2";
     this.WindowTitles.Add("Home - Civic Client Portal");
     #endregion
 }
示例#43
0
 public tblSearchResults(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[HtmlTable.PropertyNames.Id]                = null;
     this.SearchProperties[HtmlTable.PropertyNames.Name]              = null;
     this.FilterProperties[HtmlTable.PropertyNames.InnerText]         = "User Login Name Country City Company Bus";
     this.FilterProperties[HtmlTable.PropertyNames.ControlDefinition] = "width=\"100%\"";
     this.FilterProperties[HtmlTable.PropertyNames.RowCount]          = "2";
     this.FilterProperties[HtmlTable.PropertyNames.ColumnCount]       = "6";
     this.FilterProperties[HtmlTable.PropertyNames.Class]             = null;
     this.FilterProperties[HtmlTable.PropertyNames.TagInstance]       = "1";
     this.WindowTitles.Add("Internal");
     #endregion
 }
示例#44
0
 public UICustomersTable(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[HtmlTable.PropertyNames.Id]                = "customers";
     this.SearchProperties[HtmlTable.PropertyNames.Name]              = null;
     this.FilterProperties[HtmlTable.PropertyNames.InnerText]         = "Company\r\n\r\nContact\r\n\r\nCountry\r\n\r\nAlfreds";
     this.FilterProperties[HtmlTable.PropertyNames.ControlDefinition] = "id=\"customers\"";
     this.FilterProperties[HtmlTable.PropertyNames.RowCount]          = "7";
     this.FilterProperties[HtmlTable.PropertyNames.ColumnCount]       = "3";
     this.FilterProperties[HtmlTable.PropertyNames.Class]             = null;
     this.FilterProperties[HtmlTable.PropertyNames.TagInstance]       = "6";
     this.WindowTitles.Add("HTML Tables");
     #endregion
 }
        public UIInsurEcomMainPageDocument1(UITestControl searchLimitContainer)
            : base(searchLimitContainer)
        {
            #region Search Criteria

            SearchProperties[HtmlControl.PropertyNames.Id]    = null;
            SearchProperties[PropertyNames.RedirectingPage]   = "False";
            SearchProperties[PropertyNames.FrameDocument]     = "True";
            FilterProperties[HtmlControl.PropertyNames.Title] = "insurE-com - Main Page";
            FilterProperties[PropertyNames.AbsolutePath]      = "/sysmaint/content/AddHouseholdTestRenewalNotice.asp";
            FilterProperties[PropertyNames.PageUrl]           = "https://www.insur-econnect.com/sysmaint/content/AddHouseholdTestRenewalNotice.asp" + "";
            WindowTitles.Add("Applied Systems UK - System Maintenance");

            #endregion
        }
        public bool CloseTab(UITestControl theTab)
        {
            // Trav Changes ;)
            var closeBtn = theTab.GetChildren().FirstOrDefault(child => child.GetProperty("AutomationID").ToString() == "closeBtn");

            if (closeBtn != null)
            {
                Thread.Sleep(50);
                //Playback.Wait(50);
                Mouse.Click(closeBtn);
                return(true);
            }

            return(false);
        }
示例#47
0
 public UIDnn_ctr733_AddUser_cTable(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[HtmlTable.PropertyNames.Id]                = "dnn_ctr733_AddUser_cblTeams";
     this.SearchProperties[HtmlTable.PropertyNames.Name]              = null;
     this.FilterProperties[HtmlTable.PropertyNames.InnerText]         = "Admin Approver\r\nAll Plans Setup Approver";
     this.FilterProperties[HtmlTable.PropertyNames.ControlDefinition] = "id=dnn_ctr733_AddUser_cblTeams border=0";
     this.FilterProperties[HtmlTable.PropertyNames.RowCount]          = "15";
     this.FilterProperties[HtmlTable.PropertyNames.ColumnCount]       = "1";
     this.FilterProperties[HtmlTable.PropertyNames.Class]             = null;
     this.FilterProperties[HtmlTable.PropertyNames.TagInstance]       = "4";
     this.WindowTitles.Add("Internal");
     #endregion
 }
示例#48
0
 public UIModalDialogPane2(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[HtmlDiv.PropertyNames.Id]                = "modalDialog";
     this.SearchProperties[HtmlDiv.PropertyNames.Name]              = null;
     this.FilterProperties[HtmlDiv.PropertyNames.InnerText]         = "<li class=\"o-content-entry\" role=\"tab\" d";
     this.FilterProperties[HtmlDiv.PropertyNames.Title]             = null;
     this.FilterProperties[HtmlDiv.PropertyNames.Class]             = "modal-frame js-auto-size";
     this.FilterProperties[HtmlDiv.PropertyNames.ControlDefinition] = "class=\"modal-frame js-auto-size\" id=\"modalDialog\" role=\"dialog\" style=\"width: 500" +
                                                                      "px;\"";
     this.FilterProperties[HtmlDiv.PropertyNames.TagInstance] = "1";
     this.WindowTitles.Add("Recent Sources");
     #endregion
 }
示例#49
0
 public CollapseAllButton(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[HtmlButton.PropertyNames.Id]                = "collapseButton";
     this.SearchProperties[HtmlButton.PropertyNames.Name]              = null;
     this.SearchProperties[HtmlButton.PropertyNames.DisplayText]       = " Collapse all ";
     this.SearchProperties[HtmlButton.PropertyNames.Type]              = "button";
     this.FilterProperties[HtmlButton.PropertyNames.Title]             = "Collapse all";
     this.FilterProperties[HtmlButton.PropertyNames.Class]             = "k-button ama-button k-button-icontext";
     this.FilterProperties[HtmlButton.PropertyNames.ControlDefinition] = "tabindex=\"0\" title=\"Collapse all\" class=";
     this.FilterProperties[HtmlButton.PropertyNames.TagInstance]       = "6";
     this.WindowTitles.Add("Microsoft Dynamics 365");
     #endregion
 }
示例#50
0
 public pInternal_Step1(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[HtmlDocument.PropertyNames.Id] = "Body";
     this.SearchProperties[HtmlDocument.PropertyNames.RedirectingPage] = "False";
     this.SearchProperties[HtmlDocument.PropertyNames.FrameDocument]   = "False";
     this.FilterProperties[HtmlDocument.PropertyNames.Title]           = "Internal";
     this.FilterProperties[HtmlDocument.PropertyNames.AbsolutePath]    = "/DDSUS10LB/DDS/Administration/UserInformation/Internal/tabid/280/ctl/AdSearch/mid" +
                                                                         "/733/Default.aspx";
     this.FilterProperties[HtmlDocument.PropertyNames.PageUrl] = "http://mddsqa.mercer.com/DDSUS10LB/DDS/Administration/UserInformation/Internal/ta" +
                                                                 "bid/280/ctl/AdSearch/mid/733/Default.aspx";
     this.WindowTitles.Add("Internal");
     #endregion
 }
示例#51
0
        public override object GetPropertyValue(UITestControl uiTestControl, string propertyName)
        {
            var    technologyElement = uiTestControl.GetProperty("UITechnologyElement") as GridCellElement;
            object result            = null;

            if (technologyElement != null)
            {
                if (propertiesMap.ContainsKey(propertyName))
                {
                    var cellInfo = this.GetCellInfo(uiTestControl);
                    result = GridCommunicator.Instance.GetStyleInfoProperty(cellInfo, propertyName);
                }
                else
                {
                    if (propertyName == UITestControl.PropertyNames.BoundingRectangle)
                    {
                        try
                        {
                            int num, num1, num2, num3;
                            technologyElement.GetBoundingRectangle(out num, out num1, out num2, out num3);
                            result = new System.Drawing.Rectangle(num, num1, num2, num3);
                        }
                        catch
                        {
                            result = System.Drawing.Rectangle.Empty;
                        }
                    }
                    else if (propertyName == UITestControl.PropertyNames.FriendlyName)
                    {
                        result = technologyElement.FriendlyName;
                    }
                    else if (propertyName == UITestControl.PropertyNames.NativeElement)
                    {
                        result = technologyElement.NativeElement;
                    }
                    else if (propertyName == UITestControl.PropertyNames.WindowHandle)
                    {
                        result = technologyElement.WindowHandle;
                    }
                    else
                    {
                        result = technologyElement.GetPropertyValue(propertyName);
                    }
                }
            }

            return(result);
        }
示例#52
0
        private UITestControl GetChildByAutomationIDPathImpl(UITestControl parent, int bookmark, params string[] automationIDs)
        {
            //Find all children
            var children = parent.GetChildren();

            if (children == null)
            {
                try
                {
                    throw new UITestControlNotFoundException("Cannot find children of " + parent.GetProperty("AutomationID") +
                                                             " and friendly name: " + parent.FriendlyName +
                                                             " and control type: " + parent.ControlType +
                                                             " and class name: " + parent.ClassName + ".");
                }
                catch (NullReferenceException)
                {
                    throw new UITestControlNotFoundException("Cannot find children of " + parent.GetProperty("AutomationID") + ".");
                }
            }

            //Find some child
            var firstChildFound = children.FirstOrDefault(child =>
            {
                var childId = child.GetProperty("AutomationID");
                if (childId != null)
                {
                    var childAutoId = childId.ToString();
                    return(childAutoId.Contains(automationIDs[bookmark]) ||
                           child.FriendlyName.Contains(automationIDs[bookmark]) ||
                           child.ControlType.Name.Contains(automationIDs[bookmark]) ||
                           child.ClassName.Contains(automationIDs[bookmark]));
                }
                return(false);
            });

            if (firstChildFound == null)
            {
                throw new UITestControlNotFoundException("Cannot find " + automationIDs[bookmark] +
                                                         " control within parent" +
                                                         " with automation ID: " + parent.GetProperty("AutomationID") +
                                                         " and friendly name: " + parent.FriendlyName +
                                                         " and control type: " + parent.ControlType +
                                                         " and class name: " + parent.ClassName + ".");
            }

            //Return child or some child of child...
            return(bookmark == automationIDs.Count() - 1 ? firstChildFound : GetChildByAutomationIDPathImpl(firstChildFound, ++bookmark, automationIDs));
        }
示例#53
0
        /// <summary>
        /// Creates the native page.
        /// </summary>
        /// <param name="pageType">Type of the page.</param>
        /// <returns>The internal document.</returns>
        private HtmlDocument CreateNativePage(Type pageType)
        {
            Func <UITestControl, IBrowser, Action <HtmlControl>, HtmlDocument> function;

            if (!this.pageCache.TryGetValue(pageType, out function))
            {
                function = PageBuilder <UITestControl, HtmlDocument> .CreateElement(pageType);

                this.pageCache.Add(pageType, function);
            }

            UITestControl parentElement = this.window.Value;

            // Check to see if a frames reference exists
            var isFrameDocument = false;
            PageNavigationAttribute navigationAttribute;

            if (pageType.TryGetAttribute(out navigationAttribute) && !string.IsNullOrWhiteSpace(navigationAttribute.FrameName))
            {
                Func <UITestControl, HtmlFrame> frameFunction;
                if (!this.frameCache.Value.TryGetValue(navigationAttribute.FrameName, out frameFunction))
                {
                    throw new PageNavigationException("Cannot locate frame with ID '{0}' for page '{1}'", navigationAttribute.FrameName, pageType.Name);
                }

                parentElement   = frameFunction(parentElement);
                isFrameDocument = true;

                if (parentElement == null)
                {
                    throw new PageNavigationException(
                              "Cannot load frame with ID '{0}' for page '{1}'. The property that matched the frame did not return a parent document.",
                              navigationAttribute.FrameName,
                              pageType.Name);
                }
            }

            var documentElement = function(parentElement, this, null);

            if (isFrameDocument)
            {
                // Set properties that are relevant to the frame.
                documentElement.SearchProperties[HtmlDocument.PropertyNames.FrameDocument]   = "True";
                documentElement.SearchProperties[HtmlDocument.PropertyNames.RedirectingPage] = "False";
            }

            return(documentElement);
        }
示例#54
0
        public static bool VerifyBalanceDueAmountDisplayed()
        {
            var           prop = GetCustomerCollectionsWindowProperties();
            UITestControl due  = null;

            try
            {
                due = Actions.GetWindowChild(prop, ARControls.BalanceDue);
            }
            catch (Exception)
            {
                //Suppress any expcetion here
            }

            return(due != null);
        }
示例#55
0
 public UIUidatepickerdivPane(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[HtmlDiv.PropertyNames.Id]                = "ui-datepicker-div";
     this.SearchProperties[HtmlDiv.PropertyNames.Name]              = null;
     this.FilterProperties[HtmlDiv.PropertyNames.InnerText]         = "Prev\r\n\r\nNext\r\n\r\nJanFebMarAprMayJunJulAug";
     this.FilterProperties[HtmlDiv.PropertyNames.Title]             = null;
     this.FilterProperties[HtmlDiv.PropertyNames.Class]             = "ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all";
     this.FilterProperties[HtmlDiv.PropertyNames.ControlDefinition] = "class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" +
                                                                      "\" id=\"ui-datepicker-div\" style=\"left: 259.41px; top: 354.79px; display: block; p" +
                                                                      "osition: absolute; z-index: 1;\"";
     this.FilterProperties[HtmlDiv.PropertyNames.TagInstance] = "14";
     this.WindowTitles.Add("Create - Coded UI test automation in MVC");
     #endregion
 }
示例#56
0
        public void SetRoundingType_Normal_ExpectedRoundingInputIsEnabled()
        {
            RibbonUIMap.CreateNewWorkflow();

            UITestControl theTab         = TabManagerUIMap.GetActiveTab();
            UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start");
            Point         workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200);

            // Drag the tool onto the workflow
            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.FormatNumber, workflowPoint1, "Format Number");

            UITestControl ctrl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "NumberFormat");

            FormatNumberUIMap.InputAllFormatNumberValues(ctrl, "1234.56", "Normal", "1", "3", "[[Result]]");
            Assert.IsTrue(FormatNumberUIMap.IsRoundingInputEnabled());
        }
示例#57
0
        public static UITestControl clickWebPopupOKButton()
        {
            UITestControl popup = new UITestControl();

            popup.TechnologyName = "MSAA";
            popup.SearchProperties.Add("ClassName", "#32770", "Name", "Message from webpage");

            //popup.SearchProperties.Add("ClassName", "Chrome_WidgetWin_1", "Name", "The page at www.demo.guru99.com says:");
            //"ControlType", "Dialog",
            UITestControl btnOK = new UITestControl(popup);

            btnOK.TechnologyName = "MSAA";
            btnOK.SearchProperties.Add("ControlType", "Button", "Name", "OK");

            return(btnOK);
        }
示例#58
0
        public static UITestControl Initialize(string path, string title)
        {
            Playback.PlaybackSettings.DelayBetweenActions         = 0;
            Playback.PlaybackSettings.ThinkTimeMultiplier         = 0.0d;
            Playback.PlaybackSettings.SkipSetPropertyVerification = true;
            Playback.PlaybackSettings.ShouldSearchFailFast        = true;
            _aut = ApplicationUnderTest.Launch(path);

            _cache = new Dictionary <string, UITestControl>();
            WinWindow window = new WinWindow();

            window.SearchProperties.Add(WinWindow.PropertyNames.Name, title);
            CacheComponentFound(window, title);
            _root = window;
            return(_root);
        }
示例#59
0
 public UIEcatest1_statedept_uTable(UITestControl searchLimitContainer) :
     base(searchLimitContainer)
 {
     #region Search Criteria
     this.SearchProperties[HtmlTable.PropertyNames.Id]                = "ecatest1_statedept_us";
     this.SearchProperties[HtmlTable.PropertyNames.Name]              = null;
     this.FilterProperties[HtmlTable.PropertyNames.InnerText]         = "[email protected]\r\n\r\n\r\n\r\n•••";
     this.FilterProperties[HtmlTable.PropertyNames.ControlDefinition] = "class=\"user_tile\" id=\"ecatest1_statedept_us\" data-session-id=\"4d612927-1957-4c72-" +
                                                                        "abf0-bc80d40daa0f\"";
     this.FilterProperties[HtmlTable.PropertyNames.RowCount]    = "1";
     this.FilterProperties[HtmlTable.PropertyNames.ColumnCount] = "3";
     this.FilterProperties[HtmlTable.PropertyNames.Class]       = "user_tile";
     this.FilterProperties[HtmlTable.PropertyNames.TagInstance] = "2";
     this.WindowTitles.Add("Sign in to ECA Client");
     #endregion
 }
示例#60
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);
        }