p_GetXMLElementCommentByIndex (QTP, TestComplete, VBScript)
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript)
Description
Get comment text from a child node specified by index.
Implementation
Private Function p_GetXMLElementCommentByIndex(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 = "#comment" Then IndexIter = IndexIter + 1 If IndexIter = intIndex Then p_GetXMLElementCommentByIndex = objColl.Item(Iter).NodeValue Exit Function End If End If Next p_GetXMLElementCommentByIndex = "" End Function