Jump to the post that solved this thread.
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UFT Datatable iterations
#1
Not Solved
Hi all,

    This is my very first question on this website, as I found this site to very helpful. My question is how can I iterate through different value from the data table. 


For example this is what I have 

FirstName lastName Age 
John.        Doe.        27
Jane.        Doe.        37
Mary         Jane.       36

So I want the datatble to write 27 for the first row 37 on the second and so on.
Can someone please help me write a loop for this so I can achieve the desired results. Thank you in advance
Reply
#2
Not Solved
(11-17-2017, 05:04 AM)Studymode Wrote: Hi all,

    This is my very first question on this website, as I found this site to very helpful. My question is how can I iterate through different value from the data table. 


For example this is what I have 

FirstName lastName Age 
John.        Doe.        27
Jane.        Doe.        37
Mary         Jane.       36

So I want the datatble to write 27 for the first row 37 on the second and so on.
Can someone please help me write a loop for this so I can achieve the desired results. Thank you in advance

you have to use SetCurrentRow method in the Datatable and then enter the value in the desired column.

Code:
datatable.setcurrentrow (1) 'Change the row number as per your requirement
datatable.Value ("ColumnName","Value") 'Eg: DataTable.Value("Age","27")

Hope this is what you are looking for.
Thanks,
SUpputuri
Reply
#3
Not Solved
(11-22-2017, 02:34 PM)supputuri Wrote:
(11-17-2017, 05:04 AM)Studymode Wrote: Hi all,

    This is my very first question on this website, as I found this site to very helpful. My question is how can I iterate through different value from the data table. 


For example this is what I have 

FirstName lastName Age 
John.        Doe.        27
Jane.        Doe.        37
Mary         Jane.       36

So I want the datatble to write 27 for the first row 37 on the second and so on.
Can someone please help me write a loop for this so I can achieve the desired results. Thank you in advance

you have to use SetCurrentRow method in the Datatable and then enter the value in the desired column.

Code:
datatable.setcurrentrow (1) 'Change the row number as per your requirement
datatable.Value ("ColumnName","Value") 'Eg: DataTable.Value("Age","27")

Hope this is what you are looking for.

Thank you so much, this is exactly what I needed, sorry for the delay in reply my password got mixed up but I really do appreciate your help.
Reply
Jump to the post that solved this thread.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Repeat iterations Until New Value Is Seen in Column1 shayk1985 1 1,737 07-05-2018, 05:52 PM
Last Post: Ankur
  [UFT] Compare value of List with DataTable robertosalemi 2 3,037 04-06-2016, 08:12 PM
Last Post: robertosalemi
  QTP-Re-executing script after completion of all iterations JwalantBhatt0602 1 2,692 03-24-2016, 12:37 AM
Last Post: JwalantBhatt0602
Question QTP not performing iterations based on local data sheet Breaker 18 56,722 01-25-2016, 04:32 PM
Last Post: arunshuklainbox
  How To use iterations for API petchd 1 2,798 12-03-2015, 06:51 PM
Last Post: petchd

Forum Jump:


Users browsing this thread: 2 Guest(s)