What is exact difference between “while” and “do while” in
QTP ?



What is exact difference between “while” and “do while” in QTP ?..

Answer / rico

The basic difference is in the time of checking the
condition during execution of loop. In while loop the
condition is checked at the start, if it is true then
statements enclosed in the loop structure are executed ,
otherwise the loop exits and control transfers to the
statements following this loop and this process continues
until the condition becomes false.
As:
While (condition)
{
statement1;
statement2;
.
.
}
Statements following the loop


But in the case of do-while loop condition is checked at
the end of structure (i.e., at least one time the
statements enclosed in this loop structure are executed
before checking the condition)
After executing the loop statements at least once, the loop
condition is checked; if it is true then the loop body is
executed again otherwise loop exits. As:
Do
{
statement1;
statement2;
.
.
}
While (condition)
Statements following the loop

Is This Answer Correct ?    18 Yes 1 No

Post New Answer

More QTP Interview Questions

i have read that "non-reusable actions can not be called in any other test".but in 'call to copy action' copies non-reusable action in other test also..can u pls help to understand this..

0 Answers  


can any one please tell me QTP 9.2 supports which version of IE and Mozilla firefox.

1 Answers  


What is a Patch in QTP?

0 Answers  


can i automate java web application using qtp web addin only not using java addin

1 Answers   Infosys,


What is file database?

0 Answers   Syntel,






Please any on explain usage of "on error resume next","On error goto 0" with sample code....Thankyou......... when a tester is asked to execute 100 scripts in a short time..(the server will be down in another 10 min)..how he has to run those scripts?

2 Answers   Datamatics,


i have opend 2 gmails i am working with 1 gmail i want to close other gmail by usig script. 2.i have 10 links in a page all of them have same properties& names i want to click on 5link by using script. 3.i have one combobox in that i want to see all the citynames in the combobox and i have to check weather hyderabad is present or not. 4. size of objectrepository. 5.what r problems we get during writing the script. 6.is it possible to compare to excel sheets in qtp if possible wht is the script. 7.example for lowlevelrecording

3 Answers   Semantic Space,


LINUX environment supports QTP or not? LINUX environment supports QC or not?

4 Answers  


Which is the best QTP training institute in Delhi/NCR region and what is the approximate fee for QTP course (Basics and Advanced)

0 Answers  


Test Life cycle starts IS it Requirments stage or Test Initiation?

1 Answers  


How to use QTP for Regration testing, plz tell as with short Example of login window? plz tell as....

2 Answers  


what is Compile Module in QTP? what exactly it contains Functions or Actions?

1 Answers  


Categories