Exemplo n.º 1
0
        public List <string> GetTextFromColumn(string columnName)
        {
            ScrollUpWithHotKeys();
            Keyboard.Instance.PressSpecialKey(KeyboardInput.SpecialKeys.PAGEDOWN);
            var columnData = new List <string>();

            while (columnData.Count < RowCount)
            {
                var rows = UIItem.Rows;
                foreach (var listViewRow in rows)
                {
                    var row = new QADataGridRow(listViewRow, "row");
                    if (row.Exists)
                    {
                        columnData.Add(row.GetValueFromColumn(columnName));
                    }
                    if (listViewRow.Bounds.Bottom > Bounds.Bottom + 10)
                    {
                        break;
                    }
                }
                if (UIItem.ScrollBars.Vertical.IsMaximal())
                {
                    break;
                }
                for (var i = 0; i < rows.Count; i++)
                {
                    Keyboard.Instance.PressSpecialKey(KeyboardInput.SpecialKeys.DOWN);
                }
            }
            return(columnData);
        }
Exemplo n.º 2
0
        public QADataGridRow GetRow(string columnName, string value)
        {
            ScrollUpWithHotKeys();
            QADataGridRow row = null;

            while (row == null || !row.Exists)
            {
                var rows = UIItem.Rows;
                foreach (var listViewRow in rows)
                {
                    row = new QADataGridRow(listViewRow, "row").GetValueFromColumn(columnName) == value
                        ? new QADataGridRow(listViewRow, "row")
                        : new QADataGridRow(null, "no such row");
                    if (row.Exists)
                    {
                        return(row);
                    }
                    if (listViewRow.Bounds.Bottom > Bounds.Bottom + 10)
                    {
                        break;
                    }
                }
                if (UIItem.ScrollBars.Vertical.IsMaximal())
                {
                    break;
                }
                Keyboard.Instance.PressSpecialKey(KeyboardInput.SpecialKeys.PAGEDOWN);
            }

            return(row);
        }
Exemplo n.º 3
0
        /// <summary>
        ///     This is to click a row, this will also select the row
        /// </summary>
        /// <param name="zeroBasedIndex"></param>
        private Point GetRowLocationPoint(int zeroBasedIndex)
        {
            var searchCriteria = SearchCriteria.ByAutomationId(string.Format("Row_{0}", zeroBasedIndex));
            var row            = QADataGridRow.Get(searchCriteria, string.Empty, UIItem, 5000);
            var firstCell      = QAUIItem.Get(SearchCriteria.Indexed(0), string.Empty, row.UIItem, 5000);
            var location       = firstCell.Location;

            location.X -= 2;
            location.Y += 2;

            return(location);
        }
Exemplo n.º 4
0
        public List <QADataGridRow> GetRows(string columnName, string value)
        {
            var rows    = new List <QADataGridRow>();
            var allRows = UIItem.Rows;

            foreach (var rowlist in allRows)
            {
                var row = new QADataGridRow(rowlist, string.Empty);
                if (columnName == null && value == null)
                {
                    rows.Add(row);
                }
                else if (row.GetValueFromColumn(columnName) == value)
                {
                    rows.Add(row);
                }
            }

            return(rows);
        }