How to pick the GridControl cell Value using renorex

Ask general questions here.
Hari
Posts: 8
Joined: Thu Aug 04, 2011 6:11 am

How to pick the GridControl cell Value using renorex

Post by Hari » Fri Aug 05, 2011 4:11 pm

Hi,
Using ranorex I want to pick the GridControl Cell value like- ANDHRA, For that I am using the Existng code
from your Forum But Exception is comming Like -This is not recognized path.
But I am picking the path of particular cell for gridControl using RanorexSPY.
I have already added all referances and namespaces also.

I am using the Code--------


Ranorex.UIAutomation uia = "/form[@controlname='Form1']/table[@controlname='dataGridView1']/row[@accessiblename='Row 0']/cell[@accessiblename='Name Row 0']";
string value = (string)uia.AutomationElement.GetCurrentPropertyValue(ValuePattern.ValueProperty);

I request to you please send thesolution As soon as possible .

Regards,
Hari
You do not have the required permissions to view the files attached to this post.

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: How to pick the GridControl cell Value using renorex

Post by Ciege » Fri Aug 05, 2011 5:26 pm

Hari wrote:
Ranorex.UIAutomation uia = "/form[@controlname='Form1']/table[@controlname='dataGridView1']/row[@accessiblename='Row 0']/cell[@accessiblename='Name Row 0']";
string value = (string)uia.AutomationElement.GetCurrentPropertyValue(ValuePattern.ValueProperty);
Is there a reason you are using Ranorex.UIAutomation rather than Ranorex.Cell to get the cell?

You can try something like this (if you want to keep it hard coded).

Code: Select all

 Ranorex.Cell MyCell= "/form[@controlname='Form1']/table[@controlname='dataGridView1']/row[@accessiblename='Row 0']/cell[@accessiblename='Name Row 0']";  
string MyString = MyCell.Element.GetAttributeValue("AccessibleValue").ToString();
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

Hari
Posts: 8
Joined: Thu Aug 04, 2011 6:11 am

Re: How to pick the GridControl cell Value using renorex

Post by Hari » Mon Aug 22, 2011 1:05 pm

Hi,
This is not a suitable solution as I want.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to pick the GridControl cell Value using renorex

Post by Support Team » Tue Aug 23, 2011 8:21 am

Hi,

Ciege already asked
Ciege wrote:Is there a reason you are using Ranorex.UIAutomation rather than Ranorex.Cell to get the cell?
I ask you again. Is there a reason why you use UIAutomation for WinForms?
Hari wrote:This is not a suitable solution as I want.
The solution provided by ciege is exactly the solution you need for WinForms.
Would it be possible to post us a Ranorex Snapshot of your entire solution, then we can provide you another solution?
How to create a Ranorex Snapshot

Regards,
Peter
Ranorex Team