Micro Focus QTP (UFT) Forums
How to assign multiple rows to data table in runtime. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to assign multiple rows to data table in runtime. (/Thread-How-to-assign-multiple-rows-to-data-table-in-runtime)



How to assign multiple rows to data table in runtime. - geethwind - 08-24-2009

When I am testing a peice of functionality , the output is an XML with multiple rows in it. I want to assing each row to the data table at runtime, but when i run the program, my run time data table is getting only the first record in XML where as the XML has 100s of records.

how can i get multiple records onto data table

thanks for the help.


RE: How to assign multiple rows to data table in runtime. - supputuri - 08-25-2009

Hi Geeth,

Can you pls share the code that you have developed, so that we can give our inputs easly?


RE: How to assign multiple rows to data table in runtime. - geethwind - 08-26-2009

Here is the code

Code:
Set getLostRevenueLeads = WebService("EnergyRecoveryLeadService").getLostRevenueLeads(XMLWarehouse("getLostRevenueLeads"))
WebService("EnergyRecoveryLeadService").Output CheckPoint("getLostRevenueLeads_4")



I have given the expected XML
Code:
<getLostRevenueLeadsResponse>
  <getLostRevenueLeads xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://lead.wsdl.energyrecovery.pgn.com">
    <energyRecoveryLeadResp xmlns="">
      <energyRecoveryLeads>
        <score>0</score>
        <leadType>String</leadType>
        <leadDate>2009-08-20T10:29:11.8203834-07:00</leadDate>
        <leadType_code>String</leadType_code>
        <customerCode>0</customerCode>
        <premiseCode>String</premiseCode>
        <customerName>
          <lastName>String</lastName>
        </customerName>
        <address>
          <addressLine1>String</addressLine1>
        </address>
        <stockCode>String</stockCode>
        <meterId>String</meterId>
        <phase>String</phase>
        <accountStatus>String</accountStatus>
      </energyRecoveryLeads>
    </energyRecoveryLeadResp>
  </getLostRevenueLeads>
</getLostRevenueLeadsResponse>

-----------------------------------------

But the web service is returning number of similar nodes, how to capture them in the data table?


RE: How to assign multiple rows to data table in runtime. - MahalakshmiDevi - 11-19-2009

DataTable.Import "XMLFilename"