Hi,
I've been using RanorexSpy for a while and I've been able to successfully track elements. But there's on part of my application where it can't seem to recognize the columns/rows in a grid. I can only seem to recognize the whole grid as a whole and RanorexSpy sees this grid as a "Janus.Windows.GridEX.GridEX".
I've searched through forums regarding this and is my issue similar to issues people have where the solution is to use InvokeRemotely? If so, is there a tutorial for beginners regarding on how to use InvokeRemotely for a Janus.Windows.GridEX.GridEX?
Thanks
PS
Unable to recognize element in grid
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Unable to recognize element in grid
Hi,
Please take a look to following blog
http://www.ranorex.com/blog/transfering ... et-control
Regards,
Peter
Ranorex Team
Please take a look to following blog
http://www.ranorex.com/blog/transfering ... et-control
Regards,
Peter
Ranorex Team
Re: Unable to recognize element in grid
I'm fairly new regarding this so please bear with me. In the link you provided, it's trying to get items from a ListView so it uses the following:
System.Windows.Forms.ListView remoteListView = (System.Windows.Forms.ListView)control;
For my case, would it be the following?
Janus.Windows.GridEX.GridEX grid = (Janus.Windows.GridEX.GridEX)control;
Thanks
System.Windows.Forms.ListView remoteListView = (System.Windows.Forms.ListView)control;
For my case, would it be the following?
Janus.Windows.GridEX.GridEX grid = (Janus.Windows.GridEX.GridEX)control;
Thanks
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Unable to recognize element in grid
Hi,
Please take another look to this post. There will be explained how you use the invoke.
http://www.ranorex.com/forum/invokeremo ... t1002.html
Regards,
Peter
Ranorex Team
Please take another look to this post. There will be explained how you use the invoke.
http://www.ranorex.com/forum/invokeremo ... t1002.html
Regards,
Peter
Ranorex Team
Re: Unable to recognize element in grid
I've made a lot of progress regarding this. So far I'm able to find a specific cell with a specific name. The part I'm stuck on is how do I right click that cell since I can't seem find such a command with GridEX. Or is there a way to convert a GridEXcell to a Ranorex.Cell?
I've copied and pasted my code below. I keep on getting the "Object reference not set to an instance of an object" error message.
***************
Ranorex.Control gridTest = repo.File_Window.Tab.File_Task_GridInfo.AbsolutePath.ToString();
Ranorex.Cell task = (Ranorex.Cell)gridTest.InvokeRemotely(GetDelegate);
task.Click(WinForms.MouseButtons.Right);
static object GetDelegate(System.Windows.Forms.Control control, object input)
{
GridEX grid = (control as GridEX);
grid.ExpandRecords();
GridEXRow parentRow = grid.GetRow();
GridEXRow[] childrenRow = parentRow.GetChildRows();
GridEXCellCollection cell = childrenRow[0].Cells;
foreach (GridEXCell item in cell)
{
if(item.Text == "some text")
{
return.item;
}
}
return null;
}
I've copied and pasted my code below. I keep on getting the "Object reference not set to an instance of an object" error message.
***************
Ranorex.Control gridTest = repo.File_Window.Tab.File_Task_GridInfo.AbsolutePath.ToString();
Ranorex.Cell task = (Ranorex.Cell)gridTest.InvokeRemotely(GetDelegate);
task.Click(WinForms.MouseButtons.Right);
static object GetDelegate(System.Windows.Forms.Control control, object input)
{
GridEX grid = (control as GridEX);
grid.ExpandRecords();
GridEXRow parentRow = grid.GetRow();
GridEXRow[] childrenRow = parentRow.GetChildRows();
GridEXCellCollection cell = childrenRow[0].Cells;
foreach (GridEXCell item in cell)
{
if(item.Text == "some text")
{
return.item;
}
}
return null;
}
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Unable to recognize element in grid
Hi,
basically as described in this blog post only primitive types can be returned using InvokeRemotely.
So, you have to perform the click action within your method.
Therefore please have a look at the GridEXCell documentation.
Regards,
Tobias
Ranorex Support Team
basically as described in this blog post only primitive types can be returned using InvokeRemotely.
So, you have to perform the click action within your method.
Therefore please have a look at the GridEXCell documentation.
Regards,
Tobias
Ranorex Support Team