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

Explain the check points in quicktest professional?

0 Answers  


How to send QTP scripts to our colleagues?

1 Answers   Virtusa,


Why we use QTP ,We can use other tools like WR OrSilktest What r the options in Qtp that WR and Swilktest Does not have.

0 Answers   Hewitt,


what type of application we can select for automation testing and what is the entry criteria for automation

1 Answers  


Tell me one scenario, the complex functionality you have automated in your project?

0 Answers  


How many ways to configure the application in QTP,Explain

2 Answers   CTS,


Does QTP supports Linux or Unix OS?.If so which scripting is preferable? Shell we do record and playback

1 Answers  


Hello Everyone, I have a problem. QTP is capturing no action on a particular page in the application that I am trying to automate. But on the same side its working fine on other pages of the same application. Can someone please help me understand the reason behind this inconsistency.

1 Answers  


WHICH functionalities of QTP used in Banking project?

2 Answers   Tarang, Wipro,


What is the purpose of loading qtp add-ins?

0 Answers  


How can we do this one ? at runtime qtpwindow and browser aren't disply on monitor (or) aren't visible on desktop?how?

1 Answers  


what is the use of VIRTUAL OBJECTS? explain ?

10 Answers   ABC Infotech, IBM, TCS,


Categories