Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to pass all rows from data sheet in a function argument
#1
Not Solved
Hi Friends

I want to write a code which take all the values from the data table row by row as an argument of the function.

If I am using only one row data it is working fine :
BELOW IS THE CODE
Code:
SelectSourceAttribute  is a function
sSourcename=  DataTable("SourceName",  dtGlobalSheet)
sAttrbuteSearch= DataTable("AttributeName", dtGlobalSheet)
msgbox sSourcename
msgbox sAttrbuteSearch
SelectSourceAttribute sSourcename,sAttrbuteSearch

But when same code is used under a for loop its not working, please anybody tell me whats the problem

Code:
For i =1 to RowCount
    sSourcename=  DataTable("SourceName",  dtGlobalSheet)
    sAttrbuteSearch= DataTable("AttributeName", dtGlobalSheet)
    msgbox sSourcename
    msgbox sAttrbuteSearch
    SelectSourceAttribute sSourcename,sAttrbuteSearch
Next

Note: run one iteration is checked when loop is added
Reply
#2
Not Solved
try the below code.....................

Code:
For i =1 to RowCount
sSourcename= DataTable("SourceName", dtGlobalSheet)
sAttrbuteSearch= DataTable("AttributeName", dtGlobalSheet)
msgbox sSourcename
msgbox sAttrbuteSearch
DataTable.SetNextRow
Next

Srinath
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple rows of test data Bhuvana 0 1,337 01-03-2020, 09:30 PM
Last Post: Bhuvana
  Click after CheckProperty to a WebElement passed via Function argument fails naruoga 0 1,154 02-28-2019, 11:46 AM
Last Post: naruoga
  Reading data from excel sheet serenediva 1 9,598 03-03-2017, 10:07 AM
Last Post: vinod123
Question QTP not performing iterations based on local data sheet Breaker 18 56,685 01-25-2016, 04:32 PM
Last Post: arunshuklainbox
  Importing data sheet Santu 2 3,378 08-20-2015, 11:37 PM
Last Post: ADITI1992

Forum Jump:


Users browsing this thread: 2 Guest(s)