Finding specific string in a cell on a grid
Posted: Mon Nov 28, 2016 5:41 pm
Hi,
I'm trying to code a method, in order to, find a specific string in a cell.
I've searched on the forum and I came accross this method:
But I'm getting a strange result, on my report it displays the correct number of rows and cells that my table has, but all the cells are displayed as empty, example:
I added the "TableInst" to Ranorex repository using the SpyTool, but I noticed that it only added a single element of the table and under SpyTool, my table has a lot of children. I'm suspecting that the empty result it's because the method can't actually navigate into the cells information (elements).
Question: How can I find a specific string on a specific column index (1) through the method I just mentioned and then select/click on that row?
I'll leave a screenshot of my grid:
I'm trying to code a method, in order to, find a specific string in a cell.
I've searched on the forum and I came accross this method:
Code: Select all
public void findingCell()
{
repo.BO.SIGABOClient.NewSupplierInvoice.BtnLocalEntrega.Click();
IList<Row> rowList = repo.BO.GenericChooserWorkaroundForDesigner.TableInst.FindDescendants<Row>();
foreach(Row rowItem in rowList){
Report.Info("Row index: "+rowItem.Index);
IList<Cell> cellList = rowItem.Cells;
foreach(Cell cellItem in cellList){
Report.Info("Cell Info: "+cellItem.Text);
}
}
}
Code: Select all
00:09.640 Info User
Row index: 0
00:09.687 Info User
Cell Info:
00:09.687 Info User
Cell Info:
00:09.703 Info User
Cell Info:
00:09.703 Info User
Cell Info:
00:09.718 Info User
Cell Info:
00:09.734 Info User
Cell Info:
00:09.734 Info User
Row index: 1
00:09.765 Info User
Cell Info:
00:09.828 Info User
Cell Info:
00:09.828 Info User
Cell Info:
00:09.843 Info User
Cell Info:
00:09.843 Info User
Cell Info:
00:09.859 Info User
Cell Info:
00:09.859 Info User
Row index: 2
00:09.890 Info User
Cell Info:
00:09.890 Info User
Cell Info:
00:09.906 Info User
Cell Info:
00:09.906 Info User
Cell Info:
00:09.922 Info User
Cell Info:
00:09.922 Info User
Cell Info:
Question: How can I find a specific string on a specific column index (1) through the method I just mentioned and then select/click on that row?
I'll leave a screenshot of my grid: