SendTab() public static method

public static SendTab ( int waitAmt = 15 ) : void
waitAmt int
return void
Esempio n. 1
0
        public void ToolDesigners_RenameLargeView_TabOrderAndDestinationUserNameAndPassword_UiRepondingFine()
        {
            const string   ToolName = "Rename";
            const ToolType ToolType = ToolType.Rename;

            // Create the workflow
            RibbonUIMap.CreateNewWorkflow();

            // Get some variables
            UITestControl theTab = TabManagerUIMap.GetActiveTab();

            #region Test entering text into the textboxes

            //Enter test data into all the textboxes in the large view
            LargeViewUtilMethods.LargeViewTextboxesEnterTestData(ToolType, theTab);

            //Get all the textboxes off the large view
            List <UITestControl> allTextBoxesFromLargeView = LargeViewUtilMethods.GetAllTextBoxesFromLargeView(ToolName, theTab);

            //Click the done button
            LargeViewUtilMethods.ClickDoneButton(theTab, ToolName);

            //Get the first error control
            var errorControl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab,
                                                                               "Password must have a value");

            //Get the second error control
            var desErrorControl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab,
                                                                                  "Destination Password must have a value");

            //Make sure that the error controls arnt null
            Assert.IsNotNull(errorControl, "The error didnt show up");
            Assert.IsNotNull(desErrorControl, "The error didnt show up");

            //Enter data into the password boxes
            LargeViewUtilMethods.EnterDataIntoPasswordBoxes(allTextBoxesFromLargeView);

            //Click the done button
            LargeViewUtilMethods.ClickDoneButton(theTab, ToolName);

            WorkflowDesignerUIMap.OpenCloseLargeView(ToolType, theTab);

            //Try get the error controls
            errorControl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab,
                                                                           "Password must have a value");
            desErrorControl = WorkflowDesignerUIMap.FindControlByAutomationId(theTab,
                                                                              "Destination Password must have a value");

            //Make sure that the error controls are null
            Assert.IsNull(errorControl, "The error showed up");
            Assert.IsNull(desErrorControl, "The error didnt showed up");


            //Check each textbox contains the right text
            int counter = 0;
            foreach (var uiTestControl in allTextBoxesFromLargeView)
            {
                WpfEdit textbox = uiTestControl as WpfEdit;
                if (textbox != null && !textbox.IsPassword)
                {
                    Assert.AreEqual("[[theVar" + counter.ToString(CultureInfo.InvariantCulture) + "]]", textbox.Text, "the wrong text was in the textbox");
                }

                counter++;
            }

            #endregion

            #region Test tabbing

            //Set the focus into the first textbox
            allTextBoxesFromLargeView[0].SetFocus();

            //Tab through the controlls
            int numberOfTabsToLastTextbox = 7;
            for (int i = 0; i < numberOfTabsToLastTextbox; i++)
            {
                KeyboardCommands.SendTab(50);
            }
            //Assert that the focus is in the last textbox
            Assert.IsTrue(allTextBoxesFromLargeView[allTextBoxesFromLargeView.Count - 1].HasFocus, "The tabbing is out of order");

            #endregion
        }
Esempio n. 2
0
        public void SqlBulkInsertTest_OpenLargeViewAndEnterAnInvalidBatchAndTimeoutSizeAndClickDone_CorrectingErrorsAndClickDoneWillReturnToSmallView()
        {
            // Open the Explorer
            ExplorerUIMap.EnterExplorerSearchText("Sql Bulk Insert Large View");

            // Open the Workflow
            ExplorerUIMap.DoubleClickOpenProject("localhost", "UI TEST", "Sql Bulk Insert Large View");
            var theTab = TabManagerUIMap.GetActiveTab();

            //Select a database
            var dbDropDown = GetControlById("UI__Database_AutoID", theTab) as WpfComboBox;

            Mouse.Click(dbDropDown, new Point(10, 10));
            WaitForControlLoad();
            if (dbDropDown != null)
            {
                var listOfDbNames = dbDropDown.Items.Select(i => i as WpfListItem).ToList();
                var databaseName  = listOfDbNames.SingleOrDefault(i => i.DisplayText.Contains(TestingDb));
                Mouse.Click(databaseName, new Point(5, 5));
            }
            WaitForControlLoad(5000);

            //Select a table
            var tableDropDown = GetControlById("UI__TableName_AutoID", theTab) as WpfComboBox;

            Mouse.Click(tableDropDown, new Point(10, 10));
            WaitForControlLoad(10000);
            if (tableDropDown != null)
            {
                var listOfTableNames = tableDropDown.Items.Select(i => i as WpfListItem).ToList();
                WaitForControlLoad();
                Mouse.Click(listOfTableNames[TableIndex], new Point(5, 5));
            }
            WaitForControlLoad(5000);

            UITestControl controlOnWorkflow = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "DsfSqlBulkInsertActivity");

            //Open the large view using context menu
            WorkflowDesignerUIMap.OpenCloseLargeViewUsingContextMenu(theTab, "DsfSqlBulkInsertActivity");

            WaitForControlLoad(5000);

            //Enter a few mappings

            // THIS IS FAULTY LOGIC!!!!
            var getFirstTextbox = WorkflowDesignerUIMap.GetSqlBulkInsertLargeViewFirstInputTextbox(controlOnWorkflow);

            if (getFirstTextbox == null)
            {
                throw new Exception("Failed to Locate Text Box");
            }

            Mouse.Click(getFirstTextbox);

            KeyboardCommands.SendKey("^a^xrecord().id");
            KeyboardCommands.SendTab();
            KeyboardCommands.SendKey("^a^xrecord().name");
            KeyboardCommands.SendTab();
            KeyboardCommands.SendKey("^a^xrecord().mail");
            KeyboardCommands.SendTab();
            WaitForControlLoad();

            var batchSize = GetControlById("UI__BatchSize_AutoID", theTab);

            MouseCommands.ClickControlAtPoint(batchSize, new Point(5, 5));
            KeyboardCommands.SendKey("^a^x-2");

            var timeout = GetControlById("UI__Timeout_AutoID", theTab);

            MouseCommands.ClickControlAtPoint(timeout, new Point(5, 5));
            KeyboardCommands.SendKey("^a^x-2");

            var result = GetControlById("UI__Result_AutoID", theTab);

            MouseCommands.ClickControlAtPoint(result, new Point(5, 5));
            KeyboardCommands.SendKey("^a^x-2");

            var done = GetControlById("DoneButton", theTab);

            MouseCommands.ClickControlAtPoint(done, new Point(5, 5));

            WaitForControlLoad();

            var batchErrorMessage = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Batch size must be a number");

            MouseCommands.MoveAndClick(new Point(batchErrorMessage.GetChildren()[0].BoundingRectangle.X + 5, batchErrorMessage.GetChildren()[0].BoundingRectangle.Y + 5));
            KeyboardCommands.SendKey("^a^x200");

            var timeoutErrorMessage = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Timeout must be a number");

            MouseCommands.MoveAndClick(new Point(timeoutErrorMessage.GetChildren()[0].BoundingRectangle.X + 5, timeoutErrorMessage.GetChildren()[0].BoundingRectangle.Y + 5));
            KeyboardCommands.SendKey("^a^x200");

            MouseCommands.ClickControlAtPoint(done, new Point(5, 5));
            batchErrorMessage   = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Batch size must be a number");
            timeoutErrorMessage = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Timeout must be a number");

            Assert.IsNull(batchErrorMessage);
            Assert.IsNull(timeoutErrorMessage);
        }