Ranorex

ElementFindChildrenValue and ElementGetChildFieldItem

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



Joined: 26 Oct 2007
Posts: 49
Location: Texas

PostPosted: Wed Jan 02, 2008 9:33 pm    Post subject: ElementFindChildrenValue and ElementGetChildFieldItem
According to the documentaion, ElementGetChildFieldItem takes the index of the element as an argument.

However, ElementGetChildrenValue returns not a list of indices but rather just the count of the number of elements matching that value.

Isn't then the example for ElementGetChildrenValue incorrect?

How can I find the index of an element with a particular value so that I can select it?
Back to top
View user's profile Send private message
Support Team
Site Admin


Joined: 07 Jul 2006
Posts: 257

PostPosted: Thu Jan 03, 2008 12:11 pm    Post subject:
ElementGetChildrenValue searches the subtree of an element and internally saves the children that match the specified value. It then returns the number of saved children, i.e. the number of children matching the specified value.

The ElementGetChildFieldItem method is just a helper method to retrieve the elements internally saved by the ElementGetChildrenValue method. The index passed as an argument may range from zero to the number returned by the ElementGetChildrenValue method minus 1.

So, the documentation is correct and the example should work as well (I just checked that) Smile

Alex
Ranorex Support Team
Back to top
View user's profile Send private message Visit poster's website
jasong



Joined: 26 Oct 2007
Posts: 49
Location: Texas

PostPosted: Thu Jan 31, 2008 9:41 pm    Post subject: works like a charm
Thanks for the clue! Now I have things working very smoothly.
Back to top
View user's profile Send private message
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