- 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. - 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: - call test_name ( [ parameter1, parameter2, ...parametern ] ); - iv. The call_close statement has the following syntax:
- 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. - What is the use of treturn and texit statements in the test script? - a) The treturn and texit statements are used to stop execution of called tests.
i. The treturn statement stops the current test and returns control to the calling test.
ii. The texit statement stops test execution entirely, unless tests are being called from a batch test. In this case, control is returned to the main batch test.
b) Both functions provide a return value for the called test. If treturn or texit is not used, or if no value is specified, then the return value of the call statement is 0.
treturn
c) The treturn statement terminates execution of the called test and returns control to the calling test.
The syntax is:
treturn [( expression )];
d) The optional expression is the value returned to the call statement used to invoke the test.
texit
e) When tests are run interactively, the texit statement discontinues test execution. However, when tests are called from a batch test, texit ends execution of the current test only; control is then returned to the calling batch test.
The syntax is:
texit [( expression )]; - Where do you set up the search path for a called test. - a) The search path determines the directories that WinRunner will search for a called test.
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. - How you create user-defined functions and explain the syntax? - a) A user-defined function has the following structure:
[class] function name ([mode] parameter…)
{
declarations;
statements;
}
b) The class of a function can be either static or public. A static function is available only to the test or module within which the function was defined.
c) Parameters need not be explicitly declared. They can be of mode in, out, or inout. For all non-array parameters, the default mode is in. For array parameters, the default is inout. The significance of each of these parameter types is as follows:
in: A parameter that is assigned a value from outside the function.
out: A parameter that is assigned a value from inside the function.
inout: A parameter that can be assigned a value from outside or inside the function. - What does static and public class of a function means? - a) The class of a function can be either static or public.
b) A static function is available only to the test or module within which the function was defined.
c) Once you execute a public function, it is available to all tests, for as long as the test containing the function remains open. This is convenient when you want the function to be accessible from called tests. However, if you want to create a function that will be available to many tests, you should place it in a compiled module. The functions in a compiled module are available for the duration of the testing session.
d) If no class is explicitly declared, the function is assigned the default class, public. - What does in, out and input parameters means? - a) in: A parameter that is assigned a value from outside the function.
b) out: A parameter that is assigned a value from inside the function.
c) inout: A parameter that can be assigned a value from outside or inside the function. - 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 )]; - 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. - 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]; - 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). - 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" ] ] ); - How do you update your expected results? -
- How do you run your script with multiple sets of expected results? -
- How do you view and evaluate test results for various check points? -
- How do you view the results of file comparison? -
- What is the purpose of Wdiff utility? -
- What are batch tests and how do you create and run batch tests ? -
- How do you store and view batch test results? -
- How do you execute your tests from windows run command? -
- Explain different command line options? -
- What TSL function you will use to pause your script? -
- What is the purpose of setting a break point? -
- What is a watch list? -
- During debugging how do you monitor the value of the variables? -
- What are the reasons that WinRunner fails to identify an object on the GUI? - a) WinRunner fails to identify an object in a GUI due to various reasons.
i. The object is not a standard windows object.
ii. If the browser used is not compatible with the WinRunner version, GUI Map Editor will not be able to learn any of the objects displayed in the browser window. - What do you mean by the logical name of the object. - a) An object’s logical name is determined by its class. In most cases, the logical name is the label that appears on an object.
- If the object does not have a name then what will be the logical name? - If the object does not have a name then the logical name could be the attached text.
- What is the different between GUI map and GUI map files? - a) The GUI map is actually the sum of one or more GUI map files. There are two modes for organizing GUI map files.
i. Global GUI Map file: a single GUI Map file for the entire application
ii. GUI Map File per Test: WinRunner automatically creates a GUI Map file for each test created.
b) GUI Map file is a file which contains the windows and the objects learned by the WinRunner with its logical name and their physical description. - How do you view the contents of the GUI map? - a) GUI Map editor displays the content of a GUI Map. We can invoke GUI Map Editor from the Tools Menu in WinRunner. The GUI Map Editor displays the various GUI Map files created and the windows and objects learned in to them with their logical name and physical description.
- What is startup script in WinRunner? - It is writing a script and when WinRunner starts it automatically runs the script. If you write script like invoking some application as soon as the script is run the application will be invoked for the purpose of testing
- What is the purpose of loading WinRunner add-ins? - Add-ins are used in WinRunner to load functions specific to the particular add-in to the memory. While creating a script only those functions in the add-in selected will be listed in the function generator,and while executing the script only those functions in the loaded add-in will be executed,else WinRunner will give an error message saying it does not recognize the function
- What is the purpose of GUI spy? - Using the GUI spy you can view the properties of any GUI object and your desktop. You use the spy pointer to point to an object,and the GUI spy displays the properties and their values in the GUI spy dialog box. You can choose to view all properties of an object, or only the selected set of properties that WinRunner learns.
- When you create GUI map do you record all the objects of specific objects? - a) If we are learning a window then WinRunner automatically learns all the objects in the window else we will we identifying those object, which are to be learned in a window, since we will be working with only those objects while creating scripts.
- What is the purpose of set_window command? - b) Set_Window command sets the focus to the specified window. We use this command to set the focus to the required window before executing tests on a particular window. Syntax: set_window(, time); The logical name is the logical name of the window and time is the time the execution has to wait till it gets the given window into focus.
- How do you load GUI map? - c) We can load a GUI Map by using the GUI_load command. Syntax: GUI_load();
- What is the disadvantage of loading the GUI maps through start up scripts? - d) If we are using a single GUI Map file for the entire AUT then the memory used by the GUI Map may be much high. e) If there is any change in the object being learned then WinRunner will not be able to recognize the object, as it is not in the GUI Map file loaded in the memory. So we will have to learn the object again and update the GUI File and reload it.
- How do you unload the GUI map? - f) We can use GUI_close to unload a specific GUI Map file or else we call use GUI_close_all command to unload all the GUI Map files loaded in the memory. Syntax: GUI_close(); or GUI_close_all;
Winrunner Testing Interview
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment