public static List <List <string> > GetContents(this Ranorex.Table table) { if (table.Visible) { List <List <string> > contents = new List <List <string> >(); // contents contains rows and columns int rows = table.Rows.Count; // Get total rows first rows--; for (int x = 0; x < rows; x++) { // get text from row Accessible accValue = new Accessible(table.FindSingle(string.Format("/?/?/row[@accessiblename='Row {0}']", x))); string tableValues = accValue.Value; // remove all "(null)" here // figure out how to remove space tableValues = tableValues.Replace("(null)", " "); // split line into a list and add into list of list List <string> lsRow = tableValues.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).ToList(); // split the string into an array of rows separated by new line characters contents.Add(lsRow); } return(contents); } else { return(null); } }
public static string GetCell(this Ranorex.Table grid, string cellName, int rowNumber) { rowNumber--; Ranorex.Cell myCel = grid.FindSingle(String.Format("?/?/cell[@accessiblename='{0} Row {1}']", cellName, rowNumber.ToString())); return(myCel.Text); }
public static int ColumnCount(this Ranorex.Table table) { Accessible accValue = new Accessible(table.FindSingle("/?/?/row[@accessiblename='Row 0']")); string tableValues = accValue.Value; List <string> lsRow = tableValues.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).ToList(); // split the string into an array of rows separated by new line characters return(lsRow.Count); }
public static void SelectCell(this Ranorex.Table grid, string cellName, int rowNumber, string text) { rowNumber--; Ranorex.Cell myCel = grid.FindSingle(String.Format("?/?/cell[@accessiblename='{0} Row {1}']", cellName, rowNumber.ToString())); // myCel.Click(); // myCel.ClickWithoutBoundsCheck(Location.Center); myCel.ClickWithoutBoundsCheck(Location.CenterLeft); if (text != "") { myCel.PressKeys(text); } }