ElementFindChildrenValue and ElementGetChildFieldItem : Automation API

ElementFindChildrenValue and ElementGetChildFieldItem

Class library usage, coding and language questions.

ElementFindChildrenValue and ElementGetChildFieldItem

Postby jasong » Wed Jan 02, 2008 9:33 pm

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?
jasong
 
Posts: 49
Joined: Fri Oct 26, 2007 10:38 pm
Location: Texas

Postby Support Team » Thu Jan 03, 2008 12:11 pm

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
User avatar
Support Team
Site Admin
 
Posts: 4840
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

works like a charm

Postby jasong » Thu Jan 31, 2008 9:41 pm

Thanks for the clue! Now I have things working very smoothly.
jasong
 
Posts: 49
Joined: Fri Oct 26, 2007 10:38 pm
Location: Texas


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests