Wednesday, December 2, 2009

Working With DotNetFactory Object using QTP


The below mentioned code is developed for Working With DotNetFactory Object using QTP

'Creating a DotNetFactory object pointing to a XML File
Set xmlDNFObj = DotNetFactory.CreateInstance("System.Xml.XPath.XPathDocument",, "c:\plant_catalogue.xml")

'Reading the nodes of the XML file into a list object
set xmlDNFNodes = xmlDNFObj.CreateNavigator.select( "/CATALOG/PLANT/COMMON")

'Traversing through the list of objects and displaying the values
Do While xmlDNFNodes.MoveNext

print xmlDNFNodes.current.value




loop

'Destroying the list of DotNetFactory objects
Set xmlDNFObj = Nothing


To download the XML file associated with the above program please



download plant_catalog.xml from W3School

Working With XMLUtil Object using QTP

The below mentioned code is developed for Working With XMLUtil Object using QTP

'Create a XMLUtil Object
Set xmlUtilObj = XMLUtil.CreateXML

'Load a XML file using XMLUtil Object
xmlUtilObj.LoadFile "c:\plant_catalogue.xml"

msgbox xmlUtilObj.GetRootElement()

' Get the Child elements of XML File
Set xmlChildList = xmlUtilObj.ChildElementsByPath( "/CATALOG/PLANT/COMMON")

' Traverse through the XML File to read ans display the contents
For i = 1 to xmlChildList.count
print xmlChildList.item(i).value
Next

'Destroy the XMLUtil Object
Set xmlUtilObj = Nothing


download plant_catalog.xml from W3Schools

Working With Microsoft XMLDOM using QTP

The following programme prints the values of XML file to QTP output window.

'CREATE THE COM OBJECT FOR XML USING Microsoft XMLDOM
Set xmlDOMObj = CreateObject("Microsoft.XMLDOM")

'Load XML file using
xmlDOMObj.Load("C:\plant_catalogue.xml")

'Assign PLAT nodes to a list nodes
Set nodes = xmlDOMObj.SelectNodes("/CATALOG/PLANT")
MsgBox "Total No. of Plants: " & nodes.Length

' GET ALL common NAMES of the plant
Set nodes = xmlDOMObj.SelectNodes("/CATALOG/PLANT/COMMON/text()")

' DISPLAY all the common name values
For i = 0 To (nodes.Length - 1)
NodeTitle = nodes(i).NodeValue
print "Plant Title #" & (i + 1) & ": " & NodeTitle
Next


download plant_catalog.xml from W3Schools

Friday, April 10, 2009

Rational Test Management

Here you can find all the information related to Rational Test Management

Rational Test Management Certification

Rational Test Management Courseware to quick start

Rational Test Management Certification Sample Questions

Rational Robot

Here you can find all the information related to Rational Robot

Rational Robot Certification

Rational Robot Courseware to quick start

Rational Robot Certification Sample Questions

RPT

Here you can find all the information related to Rational Performance Tester

Rational Performance Tester Certification

Rational Performance Tester Courseware to quick start

Rational Performance Tester Certification Sample Questions

RFT

Here you can find all the information related to Rational Functional Tester
Keep watching here for more details

Performance Center

Here you can find all the information related to Performance Center

Performance Center Certification

Performance Center Certification Sample Questions

Win Runner

Here you can find all the information related to Win Runner

Win Runner Certification

Win Runner Certification Sample Questions

QC

Here you can find all the information related to Quality Center

Quality Center Certification

Quality Center Certification Sample Questions