We have 10 rows of records in data table, but we have to run
4th, 5th and 6th rows only. How can we handle this scenario
in QTP?

Answers were Sorted based on User's Feedback



We have 10 rows of records in data table, but we have to run 4th, 5th and 6th rows only. How can we..

Answer / vishakha b

Go to File => Settings. In 'Run' tab, choose the option,
Run from Row. Set '4 to 6' there.

Is This Answer Correct ?    26 Yes 2 No

We have 10 rows of records in data table, but we have to run 4th, 5th and 6th rows only. How can we..

Answer / punj

Datatable.setcurrentrow(4)
then use fpr loop, 4 to 6

Is This Answer Correct ?    7 Yes 3 No

We have 10 rows of records in data table, but we have to run 4th, 5th and 6th rows only. How can we..

Answer / qtp_beginner

DataTable.ImportSheet "C:\Users\Anil\Desktop\Testing_QTP.xls
",1,"Global"
numRow=DataTable.GlobalSheet.GetRowCount
msgbox numRow
For i=4 to 6
DataTable.SetCurrentRow(i)
disp=DataTable.Value ("Test",1)
msgbox disp

Next

Is This Answer Correct ?    4 Yes 1 No

We have 10 rows of records in data table, but we have to run 4th, 5th and 6th rows only. How can we..

Answer / litan

Both the answers were correct!

Is This Answer Correct ?    3 Yes 1 No

We have 10 rows of records in data table, but we have to run 4th, 5th and 6th rows only. How can we..

Answer / sandeep guttikonda

The abouve provided both answers are correct for this case.

Let me add some more to second answer:

In QTP Data Table Methods we have three methods to work on
rows:
1) SetCurretRow
2) SetNextRow
3) SetPrevRow

Here in our case the best method is SetCurrentRow.
1) SetCurrentRow: We can use this method to take a
specified row s current row in run time datatable. By
default QTP points to 1st Sheet 1st Row.

Syntax: SetCurrentRow(Row Number)

Code:
Datatable.SetCurrentRow(4)

For Current_Row = 4 to 6 step
/* To write the data into the datatable
Datatable.value(Current_Row, Column) = "Sandeep"
OR
/* To get data from the datatable.
Cell_Value = Datatable.value(Current_Row, Column)
Next

Note: Here the variable column is respective column number
on which we want to act.

Please le me know if you need any further info.

Thanks.

Regards,
Sandeep Guttikonda

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More QTP Interview Questions

Which scripting language QTP is using?

6 Answers  


Which function is used to accesses the Properties from Repository Pls anybody can give the answer.. Thanks in advance...

2 Answers   Navis,


Have you ever written a compiled module? If yes tell me about some of the functions that you wrote.

1 Answers  


Write script to fetch the data from global sheet where row number is 3 and parameter is "text"

3 Answers   Accenture, Thomson Reuters,


what is the syntax for regular expression in QTP? how to create user defined functions in QTP?

6 Answers   CTS, MBT, TCS,






Can anyone please explain me the process of automating an application using QTP as i am new to this?

1 Answers   Fidelity,


There is a name "AJAY" how do u count no.of. "A" in that name ?

4 Answers  


Hi, I want to pass a value in to Link object. For ex: I have a link where in which contains the value like "DC4463219(Active)". Whenever i will execute the script this value "DC4463219 (Active)" will get changed. I got the value DC4463219(Active) from the link and stored that value in variable "ACTUAL". If i want to select the same link again, while recording the value DC4463219(Active) will be recorded in object repository. So, that it will not work for the next cycle of execution as the value will get changed everytime as i mentioned above. I want to pass that Acutal value in to link object. The script is as follows: Actual Script when recording: Browser("Web Login").Page("Application").Frame ("ScopeFrame").Link(DC4463219(Active)".Click But now instead of this DC4463219(Active) i want to pass a variable where i have the same value. I tried to execute the script Browser("Web Login").Page("Application").Frame ("ScopeFrame").Link(Actual).Click But it is displaying the error message as that the value which we got from Actual is not existing in Object repository. So,i made the link object as regular expression. Even it is displaying the same message as mentioned above. If you are not able to understand, feel free to contact me with nbabu11@gmail.com

1 Answers  


what is meant by function library?Public and private functions in function library? if private functions are applicable for only for the particular test means then y we have to add those to function library?

0 Answers  


1)what is the quality process in QTP? 2)how to add the .tsr file in qtp through scripting?

1 Answers   L&T,


I have the script like this: Browser("Philips Web Login").Page("Philips CL DMS2 Application").Frame("ScopeFrame").Link("DC3701737 (Active)").Click in which the value "DC3701737" will get changed and i have to use the same value in so many places. If i want to get that value "DC3701737" in to a variable, how? pls let me know if you didn't get the question. Help me out in this.

2 Answers  


What is an environment variable?

1 Answers  


Categories