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

In a flight window we have to enter the name and meal request for every passenger.In that window if we give Total passengers=1 then the Psngr1 name field and psngr1 meal request field will reflects.if we give Total passengers=2 then Psngr1 name field and psngr1 meal request field,Psngr2 name field and psngr2 meal request field will reflects and so on.if total psngrs=100 then will we capture all the fields for the psngrs to Automate the app how we can handle this scenerio thru Descriptive programming?

0 Answers  


How to open any application during Scripting in QTP?

7 Answers   Celgene, IBM,


can anyone please send me qtp framework material please its urgent

1 Answers  


What is Unicode Compatibility?

0 Answers   HCL,


What is Terminal Emulators”? Why we used in QTP.? How he works on QTP.

1 Answers  






What frame work ur using in QTP in ur current company?

7 Answers   Accenture,


Is qtp supports uni-code?

0 Answers  


hi Sudhananda reddy, in my resume, i written as , I Am working as a Test Engineer for xyz company. IS IT RIGHT OR WRONG? WHAT IS THE ACTUAL meaning of "IN XYZ COMPANY", "FOR XYZ COMPANY", "WITH XYZ COMPANY".

2 Answers  


Currently i have designed my script based on the test cases present in Quality Center. I want to run my script from quality center. Can anyone help me to get the code which will connect QTP with Quality Center and execute the test cases?

1 Answers  


how to choose the framework in qtp ? 2)when we go for the descriptive programming ?

2 Answers   Syntel,


diff between global variables and environment variables in qtp?

1 Answers   FIS,


what are pretesting activities

0 Answers  


Categories