Ranorex

Property Grid: Get items by index

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexPython
View previous topic :: View next topic  
Author Message
tkondal



Joined: 03 Nov 2006
Posts: 24

PostPosted: Mon Aug 06, 2007 4:17 pm    Post subject: Property Grid: Get items by index
Hi,
I would like to know if it is possible to get the items of a property grid by index instead of by name.

Thanks.
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Tue Aug 07, 2007 10:48 pm    Post subject:
We have no function for this, but you can do this easily as follows:

Code: click into code to enlarge
print '  Reading all property names and values'
element=Ranorex.ControlGetElement(propertyGrid)
itemCount = Ranorex.ElementFindChildren(element, Ranorex.ROLE_SYSTEM_ROW)

for index in range(0,itemCount):
    property = Ranorex.ElementGetChildFieldItem(index)
    if property == None:
        print 'Cannot read property' + str(index)
        continue;
    print '    Index = ' + str(index),
    print ' name = ' + Ranorex.ElementGetName(property),
    print ' value = ', Ranorex.ElementGetValue(property)

Jenö
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexPython All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum