CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.




Get it now !!
Send your Resume to 6000 Companies

Search Interview Questions

Question: Write and explain various loop command?

Answer: A for loop instructs WinRunner to execute one or more statements a specified number of times. It has the following syntax:
for ( [ expression1 ]; [ expression2 ]; [ expression3 ] )
statement
i. First, expression1 is executed. Next, expression2 is evaluated. If expression2 is true, statement is executed and expression3 is executed. The cycle is repeated as long
as expression2 remains true. If expression2 is false, the for statement terminates and execution passes to the first statement immediately following.
ii. For example, the for loop below selects the file UI_TEST from the File Name list
iii. in the Open window. It selects this file five times and then stops. set_window ("Open")
for (i=0; i<5; i++)
list_select_item("File_Name:_1","UI_TEST"); #Item Number2
b. A while loop executes a block of statements for as long as a specified condition is true.
It has the following syntax:
while ( expression )
statement ;
i. While expression is true, the statement is executed. The loop ends when the expression is false. For example, the while statement below performs the same function
as the for loop above.
set_window ("Open");
i=0;
while (i<5){
i++;
list_select_item ("File Name:_1", "UI_TEST"); # Item Number 2
}
c. A do/while loop executes a block of statements for as long as a specified condition is true. Unlike the for loop and while loop, a do/while loop tests the conditions at
the end of the loop, not at the beginning. A do/while loop has the following syntax:
do
statement
while (expression);
i. The statement is executed and then the expression is evaluated. If the expression is true, then the cycle is repeated. If the expression is false, the cycle is not
repeated.
ii. For example, the do/while statement below opens and closes the Order dialog box of Flight Reservation five times.
set_window ("Flight Reservation");
i=0;
do
{
menu_select_item ("File;Open Order...");
set_window ("Open Order");
button_press ("Cancel");
i++;
}
while (i<5);



Category Win Runner Interview Questions & Answers - Exam Mode / Learning Mode
Rating (0.3) By 3657 users
Added on 10/25/2009
Views 33271
Rate it!
Question: Write and explain various loop command?
Answer:

A for loop instructs WinRunner to execute one or more statements a specified number of times. It has the following syntax:
for ( [ expression1 ]; [ expression2 ]; [ expression3 ] )
statement
i. First, expression1 is executed. Next, expression2 is evaluated. If expression2 is true, statement is executed and expression3 is executed. The cycle is repeated as long
as expression2 remains true. If expression2 is false, the for statement terminates and execution passes to the first statement immediately following.
ii. For example, the for loop below selects the file UI_TEST from the File Name list
iii. in the Open window. It selects this file five times and then stops. set_window ("Open")
for (i=0; i<5; i++)
list_select_item("File_Name:_1","UI_TEST"); #Item Number2
b. A while loop executes a block of statements for as long as a specified condition is true.
It has the following syntax:
while ( expression )
statement ;
i. While expression is true, the statement is executed. The loop ends when the expression is false. For example, the while statement below performs the same function
as the for loop above.
set_window ("Open");
i=0;
while (i<5){
i++;
list_select_item ("File Name:_1", "UI_TEST"); # Item Number 2
}
c. A do/while loop executes a block of statements for as long as a specified condition is true. Unlike the for loop and while loop, a do/while loop tests the conditions at
the end of the loop, not at the beginning. A do/while loop has the following syntax:
do
statement
while (expression);
i. The statement is executed and then the expression is evaluated. If the expression is true, then the cycle is repeated. If the expression is false, the cycle is not
repeated.
ii. For example, the do/while statement below opens and closes the Order dialog box of Flight Reservation five times.
set_window ("Flight Reservation");
i=0;
do
{
menu_select_item ("File;Open Order...");
set_window ("Open Order");
button_press ("Cancel");
i++;
}
while (i<5); Source: CoolInterview.com



If you have the better answer, then send it to us. We will display your answer after the approval

Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.

Post your answer here

Inform me about updated answers to this question.
Related Questions
View Answer
Write and explain decision making command?
View Answer
Write and explain switch command?
View Answer
How do you write messages to the report?
View Answer
What is a command to invoke application?
View Answer
What is the purpose of tl_step command?
View Answer
Which TSL function you will use to compare two files?
View Answer
What is the use of function generator?
View Answer
What is the use of putting call and call_close statements in the test script?
View Answer
What is the use of treturn and texit statements in the test script?
b. To set the search path, choose Settings > General Options. The General Options dialog box opens. Click the Folders tab and choose a search path in the Search Path
for Called Tests box. WinRunner searches the directories in the order in which they are listed in the box. Note that the search paths you define remain active in future testing sessions.
View Answer
Where do you set up the search path for a called test.
View Answer
How you create user-defined functions and explain the syntax?
View Answer
What does static and public class of a function means?
View Answer
What does in, out and input parameters means?
View Answer
What is the purpose of return statement?
View Answer
What does auto, static, public and extern variables means?
View Answer
How do you declare constants?
View Answer
How do you declare arrays?
View Answer
How do you load and unload a compile module?
View Answer
Why you use reload function?
View Answer
Write and explain compile module?
View Answer

Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

View All Win Runner Interview Questions & Answers - Exam Mode / Learning Mode




India News Network
Latest 20 Questions
Payment of time- barred debt is: (a) Valid (b) Void (c) Illegal (d) Voidable
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
Cache = 0 Seconds