Krishna Kishore

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2008-12-03
17:18
384 views
how to create an XMLWareHouse Dynamically in QTP 9.2
Hi All,
i am working with XMLWarehouse in QTP 9.2, i have requirement that i need to create the xml structures at runtime, has any one got any suggestion on this
Thanks
Krishna Kishore
i am working with XMLWarehouse in QTP 9.2, i have requirement that i need to create the xml structures at runtime, has any one got any suggestion on this
Thanks
Krishna Kishore
Think beyond frontier
1 Reply
Ravindrareddi

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2008-12-04
13:21
Use these functions.
Function NewDoc(ByVal RootName)
Dim oDoc
Set oDoc = createObject("MSXML2.DOMDocument.4.0")
oDoc.LoadXML("<" & RootName & ">")
Set NewDoc = oDoc
End Function
Function addElement(ByVal oNode, ByVal Name, ByVal Text)
Dim oElement'as MSXML2.IXMLDOMElement
Set oElement = oNode.ownerDocument.createElement(Name)
oElement.text = Text
oNode.appendChild(oElement)
Set addElement = oElement
End function
Function addNode(ByVal oNode, ByVal Name)
Dim oNewNode'as MSXML2.IXMLDOMNode
Set oNewNode = oNode.ownerDocument.createElement(Name)
oNode.appendChild(oNewNode)
Set addNode = oNewNode
End Function
Function addAttribute(ByVal oNode, ByVal Name, ByVal Value)
Dim oAttribute'as MSXML2.IXMLDOMAttribute
Set oAttribute = oNode.ownerDocument.createAttribute(Name)
oAttribute.Value = Value
oNode.setAttributeNode(oAttribute)
Set addAttribute = oAttribute
End Function
Ravi
Function NewDoc(ByVal RootName)
Dim oDoc
Set oDoc = createObject("MSXML2.DOMDocument.4.0")
oDoc.LoadXML("<" & RootName & ">")
Set NewDoc = oDoc
End Function
Function addElement(ByVal oNode, ByVal Name, ByVal Text)
Dim oElement'as MSXML2.IXMLDOMElement
Set oElement = oNode.ownerDocument.createElement(Name)
oElement.text = Text
oNode.appendChild(oElement)
Set addElement = oElement
End function
Function addNode(ByVal oNode, ByVal Name)
Dim oNewNode'as MSXML2.IXMLDOMNode
Set oNewNode = oNode.ownerDocument.createElement(Name)
oNode.appendChild(oNewNode)
Set addNode = oNewNode
End Function
Function addAttribute(ByVal oNode, ByVal Name, ByVal Value)
Dim oAttribute'as MSXML2.IXMLDOMAttribute
Set oAttribute = oNode.ownerDocument.createAttribute(Name)
oAttribute.Value = Value
oNode.setAttributeNode(oAttribute)
Set addAttribute = oAttribute
End Function
Ravi