Beispiel #1
0
        /// <summary>
        ///     Selects all rows
        ///     <param name="dataGrid">UI data grid</param>
        ///     <returns>true if row selection sucessfull</returns>
        /// </summary>
        public bool SelectDataGridAllRows(bool selectAll)
        {
            var parent    = QAUIItem.GetParent(UIItem, "parent");
            var container = QAContainer.Get(SearchCriteria.ByAutomationId(parent.UIItem.Id), "container");

            var gotoRowTextBox = QATextBox.Get(SearchCriteria.ByAutomationId("dataGridGoToRow"), "(Hidden) GoToRow",
                                               container.UIItem);

            if (gotoRowTextBox != null && gotoRowTextBox.Exists)
            {
                gotoRowTextBox.UIItem.SetValue(string.Empty);
                Thread.Sleep(1000);
                if (selectAll)
                {
                    gotoRowTextBox.UIItem.SetValue("all");
                }
                else
                {
                    gotoRowTextBox.UIItem.SetValue("none");
                }
                return(true);
            }
            if (selectAll)
            {
                Report.Output("FAILURE: Failed to select all rows");
            }
            else
            {
                Report.Output("FAILURE: Failed to unselect all rows");
            }
            return(false);
        }
 private void refresh()
 {
     NameTextBox.Clear();
     GenderComboBox.SelectedIndex = 0;
     DOBTextBox.Clear();
     QATextBox.Clear();
     DOHTextBox.Clear();
     typeComboBox.SelectedIndex = 0;
     AdressTextBox.Clear();
     passwordTextBox.Clear();
     confrimPWTextBox.Clear();
     PayTextBox.Clear();
     bindingDateGridView(null);
 }
Beispiel #3
0
        /// <summary>
        ///     Copies data to the clipboard from the grid using data grid instead of keyboard shortcut CTRL-C
        /// </summary>
        /// <returns>bool to indicate whether grid based copy was possible</returns>
        private bool CopyGridToClipboardAsCSV(Window window)
        {
            var parent    = QAUIItem.GetParent(UIItem, "parent");
            var container = QAContainer.Get(SearchCriteria.ByAutomationId(parent.UIItem.Id), "container");

            var copyToClipboard = QATextBox.Get(SearchCriteria.ByAutomationId("dataGridCopyToClipboardCSV"),
                                                "copyToClipboard", container.UIItem);

            if (copyToClipboard.Exists)
            {
                copyToClipboard.SetValue("1", false);
                return(true);
            }
            Report.Output("FAILURE: unable to copy to clipboard");
            return(false);
        }
Beispiel #4
0
        /// <summary>
        ///     Sets UI to a specific row
        ///     <param name="dataGrid">UI data grid</param>
        ///     <returns>true if row found</returns>
        /// </summary>
        public bool SelectMultipleDataGridRows(List <int> zeroBasedTargetRows)
        {
            var parent         = QAUIItem.GetParent(UIItem, "parent");
            var container      = QAContainer.Get(SearchCriteria.ByAutomationId(parent.UIItem.Id), "container");
            var gotoRowTextBox = QATextBox.Get(SearchCriteria.ByAutomationId("dataGridGoToRow"), "(Hidden) GoToRow",
                                               container.UIItem);

            if (gotoRowTextBox != null && gotoRowTextBox.Exists)
            {
                gotoRowTextBox.UIItem.SetValue(string.Empty);
                Thread.Sleep(1000);
                gotoRowTextBox.UIItem.SetValue(string.Join(",", zeroBasedTargetRows));
                return(true);
            }
            Report.Output("FAILURE: Row not found");
            return(false);
        }
        /// <summary>
        ///     Returns text of inner TextBox or Label
        /// </summary>
        public static string GetInnerText(this UIItem uIItem)
        {
            string nodeName;
            var    textItem = QATextBox.Get(SearchCriteria.All, "UIItem text", uIItem, 1);

            if (textItem.Exists)
            {
                nodeName = textItem.Text;
            }
            else
            {
                var label = QALabel.Get(SearchCriteria.All, "UIItem button", uIItem, 1);
                nodeName = label.Exists
                    ? label.Text
                    : string.Empty;
            }
            return(nodeName);
        }