Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selecting a field in database for a loop
#1
Solved: 10 Years, 8 Months, 3 Weeks ago
This is a total newbie question and I apology that: but if I have values in datatable fields A1 - A10 (which I want to run in QTP), but want to start he counting from A2 field, how do I do it? This script is for QTP flight demo:

Code:
For i = 1 to datatable.GetRowCount
Dialog("Login").WinEdit("Agent Name:").Set DataTable("A", dtGlobalSheet)
Dialog("Login").WinEdit("Password:").Set DataTable("B", dtGlobalSheet)
wait 2
datatable.SetNextRow
Next
Dialog("Login").WinButton("Cancel").Click
ExitRun
How should I modify this? I know I should somehow add GetParameter("A").ValueByRow(3), but couldn't get it to work. Thanks for your answers!
Reply
#2
Solved: 10 Years, 8 Months, 3 Weeks ago
Question is not clear.
Did you mean you want to start fetching values from 3rd row onwards?(leaving the first 2 rows?)
If so you can write like this
Code:
For i = 3 to datatable.GetRowCount
Datatable.setcurrentrow=i
Dialog("Login").WinEdit("Agent Name:").Set DataTable("A", dtGlobalSheet)
Dialog("Login").WinEdit("Password:").Set DataTable("B", dtGlobalSheet)
wait 2
Next
Reply
#3
Solved: 10 Years, 8 Months, 3 Weeks ago
This forum is meant for people to come up and ask questions and the name of this section is beginners which clearly means that you have no idea about QTP. Please dont be sorry about it. I would actually request you to come up with any question you have irrespective of the weight it carries. However, before you ask search this forum. It is a good practice as several people have moved from asking questions to answering questions and hence the repository should contain answers for the basic questions. If you do not get what you want please do not hesitate to ask.

Ask questions, clarification is better than assumption.

For the answer you look for it should be i = 2 to... I believe A2 refers to second row, aint it?
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#4
Solved: 10 Years, 8 Months, 3 Weeks ago
Thanks a lot for your answers. It helped a lot Smile I know that I probably should have written more detailed, but I guess you guys still were able to understand what I was looking for.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  getting the value from the field learning 0 905 03-19-2019, 09:13 AM
Last Post: learning
  QTP not selecting appropriate webelement from the webtable..Need Solution satishkumarm 11 21,032 03-23-2016, 12:47 PM
Last Post: Swetha_Bayya
  Selecting values from drop down using QTP. prempujaripati 2 46,361 06-26-2014, 06:06 PM
Last Post: rasmirani
  Selecting file saved in a location excellentpawan 1 3,814 02-25-2014, 02:05 PM
Last Post: guin.anirban
  Selecting a value from a Dropdown qtpbeginner78 12 17,522 06-10-2013, 11:10 AM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)