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

WHAT ARE THE SHORTCUT KEYS IN QTP?

4 Answers   TCS,


Explain data driven framework?

0 Answers  


How to work with multiple browsers when opened in the window, write the script for it

2 Answers   Verizon,


I had installed QTP 9.2. It is working fine but whenever I open QTP, it is trying to reinstall the below-mentioned files again and again "QTP92PS82UPGRADE.exe", "recogn.dll". If anybody has these files, please provide those files in this site or you can send that files to my mail id also (lravi4u@yahoo.com). If you don't know where the files will be in the QTP, search in the QTP software CD or path of QTP program installed (C:\Program Files\Mercury Interactive\QuickTest Professional)

0 Answers  


what is the syntax for regular expression in QTP? how to create user defined functions in QTP?

6 Answers   CTS, MBT, TCS,






Is it possible for QTP to capture the objects in word document.If so please give me the code.Thank you.

2 Answers  


How to handle recovery scenario for a application crash.write script for this.

2 Answers   Polaris, TCS,


What is diffrence between Global variables and Environment variables...Anybody can give me answer..Thanks in advance..

3 Answers   IBM,


In a web page when we enter the city name corresponding zip code is coming in the required field.Can any one please write how to test using QTP,whether this code is coming from Database or not.

1 Answers  


Suppose there is a link present somewhere in an excel sheet. Find the link and click on it. How to write a script using Excel application object in QTP?

1 Answers  


how to retrieve the xml file data through qtp. can anybody send script for this..

3 Answers   Synechron,


What is the basic concept of quicktest professional?

0 Answers  


Categories