0

I am trying to automate a test scenario using UFT 14.0, where I am using excel to store my test data and using ADODB concept to fetch the test data.

I need to run a single flow from start to end, and in between, a part of the flow needs to be iterated with different sets of data.

Eg: I need to login to makemytrip.com, book a ticket for 10 person with their personal details and then log out. So login happens once, but booking the ticket needs to be iterated 10 times and with different set of data and then finally we logout. I have 2 sheets in test data , first sheet has login details, the other sheet contains passengers details. How can it be achieved using excel multiple rows concept??

Thanks in Advance. :)

Running a single test flow in QTP but a part of the flow needs to be iterated multiple times

Priya
  • 1
  • 1
  • You need to write the logic to run iteration multiple times with different sets of data based on your record set values. Eg. `For Loop`... – ManishChristian Oct 13 '17 at 13:21

1 Answers1

0

You can iterate the record set obtained from the query. For example :

For i=0  to objRecordset.recordcount -1  
    testData1= objRecordset.fields(Colname1)
    testData2= objRecordset.fields(Colname2)
    testData3= objRecordset.fields(Colname3)
    'Perform required acitions
    objRecordset.movenext
Next

Hope this helps. Regards, Sandeep Jaju

  • Thanks a lot Sandeep, it did work, but partially. The problem arises because I am using data from 2 sheets in excel, and somehow it's entering in infinite loop condition. Also I am unable to sink the rows from one sheet to other sheet – Priya Oct 16 '17 at 21:41
  • Is the issue solved ? if now then could you provide the code here so that i can analyse it once. – Sandeep jaju Oct 23 '17 at 05:32