p_GetXMLElementTextByIndex (QTP, TestComplete, VBScript)
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript)
Description
Get inner text from a child node specified by index.
Implementation
Private Function p_GetXMLElementTextByIndex(ByRef objXMLElement, ByVal intIndex) Dim objColl, Iter, IndexIter Set objColl = objXMLElement.ChildNodes IndexIter = -1 For Iter=0 To objColl.length-1 If objColl.Item(Iter).NodeName = "#text" Then IndexIter = IndexIter + 1 If IndexIter = intIndex Then p_GetXMLElementTextByIndex = objColl.Item(Iter).NodeValue Exit Function End If End If Next p_GetXMLElementTextByIndex = "" End Function