|
1)
What is the purpose of return statement?
a)
This statement passes control back
to the calling function or test. It also returns the value of the evaluated
expression to the calling function or test. If no expression is assigned to the
return statement, an empty string is returned.
Syntax:
return [( expression )];
2)
What does auto, static, public and extern variables means?
a)
auto:
An auto variable can be declared only within a function and is local to that
function. It exists only for as long as the function is running. A new copy of
the variable is created each time the function is called.
b)
static:
A static variable is local to the function, test, or compiled module in which it
is declared. The variable retains its value until the test is terminated by an
Abort command. This variable is initialized each time the definition of the
function is executed.
c)
public:
A public variable can be declared only within a test or module, and is available
for all functions, tests, and compiled modules.
d)
extern:
An extern declaration indicates a reference to a public variable declared
outside of the current test or module.
3)
How do you declare constants?
a)
The const specifier indicates that
the declared value cannot be modified. The class of a constant may be either
public or static. If no class is explicitly declared, the constant is assigned
the default class public. Once a constant is defined, it remains in existence
until you exit WinRunner.
b)
The syntax of this declaration is:
[class] const name [= expression];
4)
How do you declare arrays?
a)
The following syntax is used to
define the class and the initial expression of an array. Array size need not be
defined in TSL.
b)
class array_name [ ] [=init_expression]
c)
The array class may be any of the
classes used for variable declarations (auto, static, public, extern).
5)
How do you load and unload a compile module?
a)
In order to access the functions in
a compiled module you need to load the module. You can load it from within any
test script using the load command; all tests will then be able to access the
function until you quit WinRunner or unload the compiled module.
b)
You can load a module either as a
system module or as a user module. A system module is generally a closed module
that is “invisible” to the tester. It is not displayed when it is loaded, cannot
be stepped into, and is not stopped by a pause command. A system module is not
unloaded when you execute an unload statement with no parameters (global
unload).
load (module_name [,1|0] [,1|0] );
The module_name is the name of an
existing compiled module.
Two additional, optional parameters
indicate the type of module. The first parameter indicates whether the function
module is a system module or a user module: 1 indicates a system module; 0
indicates a user module.
(Default = 0)
The second optional parameter indicates whether
a user module will remain open in the WinRunner window or will close
automatically after it is loaded: 1 indicates that the module will close
automatically; 0 indicates that the module will remain open.
(Default = 0)
c)
The unload function removes a
loaded module or selected functions from memory.
d)
It has the following syntax:
unload ( [ module_name | test_name [ ,
"function_name" ] ] );
6)
Why you use reload function?
a)
If you make changes in a module,
you should reload it. The reload function removes a loaded module from memory
and reloads it (combining the functions of unload and load).
The syntax of the reload function is:
reload ( module_name [ ,1|0 ] [ ,1|0 ]
);
The module_name is the name of an
existing compiled module.
Two additional optional parameters indicate the
type of module. The first parameter indicates whether the module is a system
module or a user module: 1 indicates a system module; 0 indicates a user module.
(Default = 0)
The second optional parameter indicates whether a
user module will remain open in the WinRunner window or will close automatically
after it is loaded. 1 indicates that the module will close automatically. 0
indicates that the module will remain open.
(Default =
0)
7)
Why does the minus
sign not appear when using obj_type(), win_type(), type()?
If using any of the type()
functions, minus signs actually means hold down the button for the previous
character. The solution is to put a backslash character "\\" before the minus
sign. This also applies to + < >.
8)
Write and explain compile module?
9)
How do you call a function from external libraries (dll).
10)
What is the purpose of load_dll?
11)
How do you load and unload external libraries?
12)
How do you declare external functions in TSL?
13)
How do you call windows APIs, explain with an example?
14)
Write TSL functions for the following interactive modes:
i.
Creating a dialog box with any
message you specify, and an edit field.
ii.
Create dialog box with list of
items and message.
iii.
Create dialog box with edit
field, check box, and execute button, and a cancel button.
iv.
Creating a browse dialog box
from which user selects a file.
v.
Create a dialog box with two
edit fields, one for login and another for password input.
15)
What is the purpose of step, step into, step out, step to cursor commands
for debugging your script?
16)
How do you update your expected results?
17)
How do you run your script with multiple sets of expected results?
18)
How do you view and evaluate test results for various check points?
19)
How do you view the results of file comparison?
20)
What is the purpose of Wdiff utility?
21)
What are batch tests and how do you create and run batch tests ?
22)
How do you store and view batch test results?
23)
How do you execute your tests from windows run command?
24)
Explain different command line options?
25)
What TSL function you will use to pause your script?
26)
What is the purpose of setting a break point?
27)
What is a watch list?
28)
During debugging how do you monitor the value of the variables?
|