how can we retrieve ten rows from the data table using

loop concept?

Answers were Sorted based on User's Feedback



how can we retrieve ten rows from the data table using loop concept?..

Answer / sreeprasad

Assume "Column1" is my column name in the Global Data

table, then use this code:

for i=1 to 10

datatable.setcurrentrow(i)

returnvalue=datatable.value("Column1","Global")

msgbox(returnvalue)

next

Is This Answer Correct ?    1 Yes 1 No

how can we retrieve ten rows from the data table using loop concept?..

Answer / nanda

Hi Sreeprasad..this will take 10 rows..but the loop will
execute no.of times that how many rows in datatable.

If u r using 9.0 or above version..

set app = createobject("quicktest.application")
set qtest = app.test

qtest.settings.run.startiteration = 10
qtest.settings.run.enditeration = 20

this script will execute only 10 rows starts from 10 th row
and ends with 20 th row.

If any queries..

nanda.dreddy@gmail.com

Is This Answer Correct ?    0 Yes 1 No

how can we retrieve ten rows from the data table using loop concept?..

Answer / baba

hello nanda, sreeprasad answer is correct... if you worked
on datatable. you will change settings in test settings in
run tab as run on one iteration only.

then it will take from 1 row to 10 only once.

but he forgot this


Function rcnt(rowcount)

if (rowcount>10) then

for i=1 to 10 step 1

val=datatable.value("column1",dtGlobalSheet)
print "Value of"& i &"row is : "&val
datatable.setnextrow

Next

else

msgbox "rowcount is less than 10, requiement is not _
satisfied"

End If

End Function

rows=datatable.getsheet("Global").getrowcount
msgbox rows

row_cnt=rcnt(rows)
print row_cnt

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More QTP Interview Questions

what is the Descriptive Progarmming? how it is help to testers in QTP?

4 Answers   TCS,


i am unable to select an item from combobox using Descriptive programming. can any one give me code for scheduling the ticket using Descriptive programming.

1 Answers  


how can i call reusable action in a function could any one explain me?

2 Answers   Livetek,


Action1: I have a value "test" stored in a variable X. I want to use that variable X in Action2 .. how?

1 Answers  


How can we open an Excel sheet through the script

8 Answers   eSymbiosis,






How can i open 5 multiple browser at once through QTP VB script

4 Answers  


what is stlc and its contents?

1 Answers  


what is the difference between development and testing

1 Answers  


What are the enhancements u did after recording ur script?

3 Answers  


Please guide me release notes of Automation once scripts are completed

0 Answers  


what is the difference between IE & Netscape in web testing on a log in page

0 Answers   TCS,


what kind of erros can be handled with the using QTP?

2 Answers   CTS, Satyam,


Categories