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
What is accessibility check point?
Can you write a script to check if the folder exists or not?
I used the below code to open QTP through VBscript?But i can unable to Invoke QTP...PLZ help me with the correct code to invoke QTP through VBS with description of the code aswell. Dim qtApp 'As QuickTest.Application 'Declare the Application object variable Dim qtTest 'As QuickTest.Test 'Declare a Test object variable Dim qtResultsOpt 'Declare a Run Results Options object variable Set qtApp = CreateObject("QuickTest.Application") 'Create the Application object qtApp.Launch 'Start QuickTest qtApp.Visible = False 'Make the QuickTest application visible qtApp.Open "C:\form", True 'Open the test in read-only mode 'set run settings for the test Set qtTest = qtApp.Test qtTest.Run 'Run the test 'WScript.StdOut.Write "Status is: " & qtTest.LastRunResults.Status 'Check the results of the test run qtTest.Close 'Close the test qtApp.quit 'Close QuickTest Pro Set qtResultsOpt = Nothing 'Release the Run Results Options object Set qtTest = Nothing 'Release the Test object Set qtApp = Nothing 'Release the Application object
How the exception handling can be done using quicktest professional?
Create flight reservation login descriptive programing (Condition: Remove the value and substitute with a variable, and then call the validation from Excel) Plz help me....... very urgent.........
Hi there, I've installed a trial version of QTP to see if it works with my product but I cant automate selecting windows from a tree view? Can anyone give me any pointers? Many Thanks
How to perform cross platform testing and cross browser testing using qtp? Can you explain giving some example?
How to indentify MS-Word objects like Menubar, Toolbar, table/columns/rows/cells etc within Word document, using QTP?
How to get the format of a webedit class in qtp. How can i know that particular webedit accept what type of format like "mm/dd/yyyy" or "$" or Alphanumeric
Hi could some one explan what is the use of the function Defination generator, And how to use the function defination generator.. Explan with the example..
How can you identify the browser and its information using QTP script?
How many types of object repository in qtp?
how can i pass a "automation script" as a parameter in a function give me need full suggestion thank inadvance
Name the properties you would use for identifying a browser and page when using descriptive programming?
How to associate shared object repository to test in qtp?