hi,
I am trying to access a grid build on Infragistics2.Win.UltraWinGrid control type. My intention is to get the below action donw :
1- get the row count
2- get the column count
3- iterate each cell value one by one
Attached is the app snapshot and spy shot.
Ranorex version-5.4.5
Any help will really get appreciate.
regards,
nir
Fetch row/column count and iterate through each cell values
-
- Posts: 10
- Joined: Fri May 12, 2017 11:21 am
Fetch row/column count and iterate through each cell values
You do not have the required permissions to view the files attached to this post.
Re: Fetch row/column count and iterate through each cell values
Hi,
What you have posted is screenshot, not snapshot. Ranorex snapshot is an xml file, containing the GUI structure. Unfortunately, screenshot is useless here. Please learn how to create a snapshot from the link in my signature. Thanks.
What you have posted is screenshot, not snapshot. Ranorex snapshot is an xml file, containing the GUI structure. Unfortunately, screenshot is useless here. Please learn how to create a snapshot from the link in my signature. Thanks.
Last edited by odklizec on Tue May 16, 2017 6:28 am, edited 1 time in total.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 10
- Joined: Fri May 12, 2017 11:21 am
Re: Fetch row/column count and iterate through each cell values
Believe it or not I have tried to take the ranorex snapshot but Ranorex iteslf gets stuck and not able to save the same.
Let me try to take it today again..if success will able to share..
regards,
Nir
Let me try to take it today again..if success will able to share..
regards,
Nir
-
- Posts: 10
- Joined: Fri May 12, 2017 11:21 am
Re: Fetch row/column count and iterate through each cell values
Unfortunately i cannot post the screenshot view due to company policy with the attachment restriction. I am able to fetch the row count successfully using the below code snippet but wondering how can i get the cells values of each rows.
var allegesTableRows = repo.FormWindow.AllegesTableRows;
int rowcnt=allegesTableRows.Rows.Count;
Any help will greatly be appreciable.
Thanks,
Nir
var allegesTableRows = repo.FormWindow.AllegesTableRows;
int rowcnt=allegesTableRows.Rows.Count;
Any help will greatly be appreciable.
Thanks,
Nir
You do not have the required permissions to view the files attached to this post.
Re: Fetch row/column count and iterate through each cell values
Hi Nir,
I would try to get the values with the following code snippet.
I hope this helps.
Best regards,
asdf
I would try to get the values with the following code snippet.
Code: Select all
string accName = repo.FormWindow.AllegesTableRows.Element.GetAttributeValueText("AccessibleName");
string accValue = repo.FormWindow.AllegesTableRows.Element.GetAttributeValueText("AccessibleValue");
Best regards,
asdf
-
- Posts: 10
- Joined: Fri May 12, 2017 11:21 am
Re: Fetch row/column count and iterate through each cell values
Thanks for the reply,
I tried the provided solution but again its returning NULL value in both cases. Also, i am bit wondering how without cell/row iteration it will fetch the value as suggested by you.
But i tried some other way as per below code snippets:
var allegesTableRows = repo.FormWindow.AllegesTableRows;
//var allegesTableCols = repo.FormWindow.AllegesTableCols;
int rowcnt=allegesTableRows.Rows.Count;
int cellCount=allegesTableRows.Rows[0].Cells.Count;
for (int i = 0; i<=rowcnt; i++)
{
for (int j = 0; j<=cellCount; j++)
{
String strvalue = allegesTableRows.Rows.Cells[j].Text.ToString();
Console.WriteLine("Value:="+strvalue);
}
}
But, now issue here is that console is printing the each cell values in a very slow manner. Its took around min 3-5(max) sec for each cell value to get fetched and displayed. Not sure why this performance issue or what is the root cause for this delay to fetch cells value from the grid.
Regards,
Nir
Regards,
Nir
I tried the provided solution but again its returning NULL value in both cases. Also, i am bit wondering how without cell/row iteration it will fetch the value as suggested by you.
But i tried some other way as per below code snippets:
var allegesTableRows = repo.FormWindow.AllegesTableRows;
//var allegesTableCols = repo.FormWindow.AllegesTableCols;
int rowcnt=allegesTableRows.Rows.Count;
int cellCount=allegesTableRows.Rows[0].Cells.Count;
for (int i = 0; i<=rowcnt; i++)
{
for (int j = 0; j<=cellCount; j++)
{
String strvalue = allegesTableRows.Rows.Cells[j].Text.ToString();
Console.WriteLine("Value:="+strvalue);
}
}
But, now issue here is that console is printing the each cell values in a very slow manner. Its took around min 3-5(max) sec for each cell value to get fetched and displayed. Not sure why this performance issue or what is the root cause for this delay to fetch cells value from the grid.
Regards,
Nir
Regards,
Nir
-
- Posts: 10
- Joined: Fri May 12, 2017 11:21 am
Re: Fetch row/column count and iterate through each cell values
Atlast after much R&D i could able to found a solution which works great way without any delay issue for the previously USED FOR loop. Below is the code snippet:
foreach(Row row in repo.FormWindow.AllegesTableRows.Rows )
{
//row.Focus();
foreach (Cell cell in row.Cells)
{
//cell.Focus();
String ColValue=cell.Element.GetAttributeValueText("AccessibleName").Trim();
String CellValue=cell.Element.GetAttributeValueText("AccessibleValue").Trim();
Console.WriteLine("ColName:="+ColValue);
Console.WriteLine("CellValue:="+CellValue);
}
}
Hope this solution helps other for their infragistric grid to get automated using Ranorex7
regards,
Nir
foreach(Row row in repo.FormWindow.AllegesTableRows.Rows )
{
//row.Focus();
foreach (Cell cell in row.Cells)
{
//cell.Focus();
String ColValue=cell.Element.GetAttributeValueText("AccessibleName").Trim();
String CellValue=cell.Element.GetAttributeValueText("AccessibleValue").Trim();
Console.WriteLine("ColName:="+ColValue);
Console.WriteLine("CellValue:="+CellValue);
}
}
Hope this solution helps other for their infragistric grid to get automated using Ranorex7
regards,
Nir
-
- Posts: 10
- Joined: Fri May 12, 2017 11:21 am
Re: Fetch row/column count and iterate through each cell values
Thanks to asfd buddy for helping to give me the idea to resolve this issue. Thank you very much!!