|
1)
Write and explain switch command?
a)
A switch statement enables
WinRunner to make a decision based on an expression that can have more than two
values.
It has the following syntax:
switch (expression )
{
case case_1: statements
case case_2: statements
case case_n: statements
default: statement(s)
}
b)
The switch statement consecutively
evaluates each case expression until one is found that equals the initial
expression. If no case is equal to the expression, then the default statements
are executed. The default statements are optional.
2)
How do you write messages to the report?
a)
To write message to a report we use
the report_msg statement
Syntax:
report_msg (message);
3)
What is a command to invoke application?
a)
Invoke_application is the function
used to invoke an application.
Syntax: invoke_application(file,
command_option, working_dir, SHOW);
4)
What is the purpose of tl_step command?
a)
Used to determine whether sections
of a test pass or fail.
Syntax:
tl_step(step_name, status, description);
5)
Which TSL function you will use to compare two files?
a)
We can compare 2 files in WinRunner
using the file_compare function.
Syntax:
file_compare (file1, file2 [, save file]);
6)
What is the use of function generator?
a)
The Function Generator provides a
quick, error-free way to program scripts. You can:
i.
Add Context Sensitive functions
that perform operations on a GUI object or get information from the application
being tested.
ii.
Add Standard and Analog
functions that perform non-Context Sensitive tasks such as synchronizing test
execution or sending user-defined messages to a report.
iii.
Add Customization functions
that enable you to modify WinRunner to suit your testing environment.
7)
What is the use of putting call and call_close statements in the test
script?
a)
You can use two types of call
statements to invoke one test from another:
i.
A call statement invokes a test
from within another test.
ii.
A call_close statement invokes
a test from within a script and closes the test when the test is completed.
iii.
The call statement has the
following syntax:
1.
call test_name ( [ parameter1, parameter2, ...parametern ] );
iv.
The call_close statement has
the following syntax:
1.
call_close test_name ( [ parameter1, parameter2, ... parametern ] );
v.
The test_name is the name of
the test to invoke. The parameters are the parameters defined for the called
test.
vi.
The parameters are optional.
However, when one test calls another, the call statement should designate a
value for each parameter defined for the called test. If no parameters are
defined for the called test, the call statement must contain an empty set of
parentheses.
|