Access to TStringGrid elements : Automation API

Access to TStringGrid elements

Class library usage, coding and language questions.

Access to TStringGrid elements

Postby genesiss » Thu Dec 16, 2010 11: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.
genesiss
 
Posts: 4
Joined: Thu Dec 16, 2010 11:07 am

Re: Access to TStringGrid elements

Postby Support Team » Thu Dec 16, 2010 1:19 pm

Hi,

It seems there is no MSAA implementation for TStringGrids.
Please have a look at following post:
any-plans-for-delphi-support-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
User avatar
Support Team
Site Admin
 
Posts: 4837
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Access to TStringGrid elements

Postby genesiss » Thu Dec 16, 2010 1:54 pm

Thank you!

I will try out approaches suggested in mentioned thread.
genesiss
 
Posts: 4
Joined: Thu Dec 16, 2010 11:07 am

Re: Access to TStringGrid elements

Postby genesiss » Fri Dec 17, 2010 3: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 5:23 pm, edited 1 time in total.
genesiss
 
Posts: 4
Joined: Thu Dec 16, 2010 11:07 am

Re: Access to TStringGrid elements

Postby sdaly » Fri Dec 17, 2010 3: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
sdaly
 
Posts: 213
Joined: Mon May 10, 2010 12:04 pm
Location: Dundee, Scotland

Re: Access to TStringGrid elements

Postby Support Team » Fri Dec 17, 2010 3: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
User avatar
Support Team
Site Admin
 
Posts: 4837
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Access to TStringGrid elements

Postby genesiss » Fri Dec 17, 2010 5:25 pm

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

Thank you for quick response!

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


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests