Page 1 of 1

ElementFindChildrenValue and ElementGetChildFieldItem

Posted: Wed Jan 02, 2008 8:33 pm
by jasong
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?

Posted: Thu Jan 03, 2008 11:11 am
by Support Team
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) :)

Alex
Ranorex Support Team

works like a charm

Posted: Thu Jan 31, 2008 8:41 pm
by jasong
Thanks for the clue! Now I have things working very smoothly.