you need use loop which will loop through number of rows in excel sheet "mydt
for i=1 to Datatable.getsheet("mydt").getrowcount
nextThanks, Ravi On Mon, Dec 17, 2012 at 2:15 PM, Kunal <[email protected]> wrote: > Insert code datatable.gettable("mydt") before getrowcount. > > Cheers, > A B > Blog - www.automation.lifegoeasy.com > > On Monday, 17 December 2012 06:35:13 UTC+5:30, Ami wrote: >> >> in this script(below) i am not being able to use GetRowCount method as you >> can see before for loop i have two lines commented out where i tried to use >> GetRowCount method to run the script as many rows as it will get imported to >> the data table but couldn't. I had to use the actual number for the rows. >> what could be the reason? can anyone please help me solve this? and please >> if anyone could tell me if i wanted to use this for loop in function (as it >> show in the script on the top) instead of in the actual script what should >> be done? >> >> thank you so much >> >> btw i m using qtp 10 on win xp on ie6 >> >> 'Declaring the function >> Function getdtvalue(mycoln) >> >> 'Add data sheet in the QTP Data Table >> DataTable.AddSheet ("mydt") >> >> 'Import the excel sheet into QTP Data Table >> DataTable.ImportSheet "C:\Documents and >> Settings\Administrator\Desktop\QTP\MyTests\Data Driven FrameWork With >> Excel\Data\TC_Gmail_Login.xls", tcnameinexcel,"mydt" >> >> getdtvalue=DataTable.Value(mycoln,"mydt") >> >> >> End Function >> >> 'dt=Datatable.GetSheet("mydt").GetRowCount >> 'msgbox dt >> For a=1 to 2 >> Datatable.SetCurrentRow(a) >> 'Datatable.SetNextRow >> >> >> tcnameinexcel=Environment.Value("TestName") >> >> >> systemutil.Run "iexplore.exe", getdtvalue("URL") >> Browser("Browser").Page("Gmail: Email from Google").WebEdit("Email").Set >> getdtvalue("UserID") >> Browser("Browser").Page("Gmail: Email from Google").WebEdit("Passwd").Set >> getdtvalue("password") >> wait 2 >> Browser("Browser").Page("Gmail: Email from Google").WebButton("Sign >> in").Click >> Browser("Browser").Page("Gmail - Inbox").Link("Sign out").Click >> Browser("Browser").Page("Gmail: Email from Google_2").Sync >> Browser("Browser").Close >> >> next > > -- > You received this message because you are subscribed to the Google > "QTP - HP Quick Test Professional - Automated Software Testing" > group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/MercuryQTP?hl=en -- You received this message because you are subscribed to the Google "QTP - HP Quick Test Professional - Automated Software Testing" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/MercuryQTP?hl=en
