How to pick the GridControl cell Value using renorex : General Questions

How to pick the GridControl cell Value using renorex

Ask general questions here.

How to pick the GridControl cell Value using renorex

Postby Hari » Fri Aug 05, 2011 5: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
Attachments
Form.jpg
Application File Demo
Form.jpg (92.47 KiB) Viewed 149 times
SnapsShot.jpg
SPY Ranorex
SnapsShot.jpg (107.78 KiB) Viewed 149 times
Hari
 
Posts: 8
Joined: Thu Aug 04, 2011 7:11 am

Re: How to pick the GridControl cell Value using renorex

Postby Ciege » Fri Aug 05, 2011 6: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...
User avatar
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: How to pick the GridControl cell Value using renorex

Postby Hari » Mon Aug 22, 2011 2:05 pm

Hi,
This is not a suitable solution as I want.
Hari
 
Posts: 8
Joined: Thu Aug 04, 2011 7:11 am

Re: How to pick the GridControl cell Value using renorex

Postby Support Team » Tue Aug 23, 2011 9: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to General Questions

Who is online

Users browsing this forum: No registered users and 1 guest