Access to TStringGrid elements

Class library usage, coding and language questions.
genesiss
Posts: 4
Joined: Thu Dec 16, 2010 10:07 am

Access to TStringGrid elements

Post by genesiss » Thu Dec 16, 2010 10:16 am

Hi!

I'm trying to access elements in TStringGrid ( which is - as google suggested a delphi object: http://delphi.wikia.com/wiki/TStringGrid_Class ).

How could I get rows inside the grid?

Thank you for your time.

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

Re: Access to TStringGrid elements

Post by Support Team » Thu Dec 16, 2010 12:19 pm

Hi,

It seems there is no MSAA implementation for TStringGrids.
Please have a look at following post:
http://www.ranorex.com/forum/any-plans- ... t1515.html

You can also try to access your grid with our GDI Plug-In:
http://www.ranorex.com/blog/automation- ... n#more-926

Regards,
Tobias
Support Team

genesiss
Posts: 4
Joined: Thu Dec 16, 2010 10:07 am

Re: Access to TStringGrid elements

Post by genesiss » Thu Dec 16, 2010 12:54 pm

Thank you!

I will try out approaches suggested in mentioned thread.

genesiss
Posts: 4
Joined: Thu Dec 16, 2010 10:07 am

Re: Access to TStringGrid elements

Post by genesiss » Fri Dec 17, 2010 2:15 pm

It works with GDI Capture Plug-In.

But now I have another problem:

I want to edit some text elements (with *.TextValue = "...") - but Ranorex recognizes them as RawText elements. How could I edit these elements?

Thank you.
Ranorex.SetAttributeFailedException: Setting attribute 'text' failed on element '{RawText:2010}'. ---> System.NotImplementedException: The method or operation is not implemented.
at Ranorex.Plugin.RawTextFlavorElement.SetAttributeValue(Element element, String name, Object value)
at Ranorex.Core.Element.SetAttributeValue(String name, Object value)
--- End of inner exception stack trace ---
at Ranorex.Core.Element.SetAttributeValue(String name, Object value)
at Ranorex.Text.set_TextValue(String value)
...
Last edited by genesiss on Fri Dec 17, 2010 4:23 pm, edited 1 time in total.

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Access to TStringGrid elements

Post by sdaly » Fri Dec 17, 2010 2:20 pm

Try clicking the item and entering through the keyboard. As far as I am aware rawtext is readonly, you cannot modify -

Dim rawtext as rawtext = rxpath
rawtext.click
keyboard.press("1234")

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

Re: Access to TStringGrid elements

Post by Support Team » Fri Dec 17, 2010 2:22 pm

Hi,

sorry but you can't set any attribute if you have accessed an UI element wit the GDI plugin.

Regards,
Tobias
Support Team

genesiss
Posts: 4
Joined: Thu Dec 16, 2010 10:07 am

Re: Access to TStringGrid elements

Post by genesiss » Fri Dec 17, 2010 4:25 pm

I did it with clicking the item, as sdaly suggested.

Thank you for quick response!

Regards,
genesiss