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); }
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); }
/// <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); }
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); }