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

Hello, Can we capture only the labels of the web page in the object repository. If yes, then how. Actually my scenario is: I have to capture all the label of mercury site http://newtours.mercuryinteractive.com/tour/mercurypurchase. php. and want to copy all these labels in the notepad. So,please help me how to do this all. Thanks in advance, Gaytri

4 Answers  


please tell me how to identify the index of the link in the web table .links are not constant.example i want to click the link in the inbox ,search the item and click the partcular mail.(mail links count is not constant)

1 Answers   IBM,


IF there are seven browsers with same name open. I want to close one particular browser thru QTP. how can i do this?

3 Answers   Polaris,


Explain the terms test and business component?

0 Answers  


What is Regular Expressions?

2 Answers  






How to get line numbers in your editor in expert view?

1 Answers  


what are the different u notice in betweem QTP version 8.2 and 9.2 and what is new in QTP9.2

1 Answers  


what is defination of regression testing?

3 Answers  


HOW MANY WAYS ARE THERE TO CPY TEST IN TEST LAB

2 Answers   IGT,


A FORM CONTAINS 5 FIELDS. 1 FIELD IS ENABLED REMAINING(4) FIELDS DISABLED. MY QUESTION IS ENTER VALUES INTO 1 FIELD AFTER THAT CLICK TAB BUTTON THEN 2 FIELD ENABLE THIS PROCESS CONTINUE UPTO 5TH FIELD. HOW TO WRITE CODE IN DESCRIPTIVE PROGRAMMING. PLZ TELL ME THE PROCEDURE AND CODE FOR IT.

0 Answers   TCS,


How to handle the exceptions using the recovery scenario manager in qtp?

0 Answers  


what is the abbrivation of .mtr in action reposirtory?

8 Answers   GE,


Categories