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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the concept of object repository?

636


What r the different filters in defect in quality center

3388


How do you convert manual test cases to automated test cases?

669


How to get the particular property value?

691


How you can make an action as re-usable action?

757






What are the views available in quicktest professional (qtp)?

684


what is error and fault in terms of software quality?

1537


Explain how Does Run time data (Parameterization) is handled in QTP?

638


Hi Friends, Im planning to do certifcation in mercury Automation Tool QTP.But I Didnt get any clear details regarding course syllabus, fees, where to approach, and which certification would be useful for the experienced testers? can any one send me the details?

1614


explain how to write vb script in qtp?when will you write own script?

1954


Hi. please provide license key for QTP 9.2, I have windows XP on my machine Thanks in Advance, moreshwar

2887


If the objects hierarchy is changing from build to build, then how you will handle that condition?

712


Which environments are supported by hp qtp?

675


How to break the object spy ?

750


how could i download qtp in which i get add-in support for 'oracle' is there any way to get it? i finding but not getting pls help me out :)

1527