winRunner interview questions Set 2
 

More Winrunner questions

Winrunner Set 1

Winrunner Set 2

winrunner Set 3 

Freshers Resources

QA & Testing

Data WareHousing Computer Science Analysis  Design Operating Systems
C++ Mainframes Sap/Abap Databases HR VB
Java Jobs C#

.Net

VC++ ASP

 98)  What is the difference between script and compile module?

a.       Test script contains the executable file in WinRunner while Compiled Module is used to store reusable functions. Complied modules are not executable.

b.      WinRunner performs a pre-compilation automatically when it saves a module assigned a property value of “Compiled Module”.

c.       By default, modules containing TSL code have a property value of "main". Main modules are called for execution from within other modules. Main modules are dynamically compiled into machine code only when WinRunner recognizes a "call" statement. Example of a call for the "app_init" script:



call cso_init();

call( "C:\\MyAppFolder\\" & "app_init" );

d.      Compiled modules are loaded into memory to be referenced from TSL code in any module. Example of a load statement:



reload (“C:\\MyAppFolder\\" & "flt_lib");

or

      load ("C:\\MyAppFolder\\" & "flt_lib");



99)  Write and explain various loop command?

a.       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);



100)    Write and explain decision making command?

a.       You can incorporate decision-making into your test scripts using if/else or switch statements.

                                                               i.       An if/else statement executes a statement if a condition is true; otherwise, it executes another statement.

                  It has the following syntax:

                  if ( expression )

                              statement1;

                  [ else

                  statement2; ]



            expression is evaluated. If expression is true, statement1 is executed. If expression1 is false, statement2 is executed.

b.      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)

      }



      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.

101)    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.



102)    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);



103)    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);



104)    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);



105)    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]);



106)    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.



107)    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.



108)    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 )];



109)    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.



110)    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.        

d.      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.



111)    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.



112)    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.

113)    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 )];



114)    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.



115)    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];



116)    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).



117)    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" ] ] );



118)    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)



119)    Write and explain compile module?

a.        

120)    How do you call a function from external libraries (dll).

121)    What is the purpose of load_dll?

122)    How do you load and unload external libraries?

123)    How do you declare external functions in TSL?

124)    How do you call windows APIs, explain with an example?

125)    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.

126)    What is the purpose of step, step into, step out, step to cursor commands for debugging your script?

127)    How do you update your expected results?

128)    How do you run your script with multiple sets of expected results?

129)    How do you view and evaluate test results for various check points?

130)    How do you view the results of file comparison?

131)    What is the purpose of Wdiff utility?

132)    What are batch tests and how do you create and run batch tests ?

133)    How do you store and view batch test results?

134)    How do you execute your tests from windows run command?

135)    Explain different command line options?

136)    What TSL function you will use to pause your script?

137)    What is the purpose of setting a break point?

138)    What is a watch list?

139)    During debugging how do you monitor the value of the variables?





Technical Blogs..

Jokes & Fun
GDI+
Ado.Net Tutorial
Asp.Net Tutorial
Lectures videos
Winform Tutorial
C#.Net Tutorial
Programming Tips And Tricks
Visual C++ Tutorial
Ado.net Tutorial
ActiveX Controls Tutorial
ATL COM Tutorial
COM Tutorial
Managed C++The Buddha And His Dhamma
Bea WebLogic Interviews
TCL Programming FAQ's
Computer Science Notes
Discrete Mathematics notes
Database Management System(DBMS) Faqs
Professional Practices Faqs
Lotus Notes Faqs
Beautiful advertisements
Programming interview Questions and answers Blog List
Human Resource Tips
Tips for Windows XP Systems
Tips for Internet and Computer users
Tips for better e-mail etiquette
JavaScript Faq's
VB Script FAQ's
HTML Faq's
Perl Scripting FAQ's
Winrunner Faq'sLinux FAQ's
CCNA cisco Certification
Data WareHousing Interview
Microsoft SharePoint Interview
C++ Interview
Siebel Customer Relationship Management FAQ's
C Programming Language- Step by step learning
Unix FAQ'sSample Source Code for all languages
Various Technical and academic certifications

Source Code

Certifications

Misceleneous technical Faq's

VC++  Blog

Data structures Blog

.Net Blog

C#.Net Blog

VB.Net Blog

ASP.Net Blog

ADO.Net Blog

Winform Blog

WCF / WPF Blog

Job Openings

Operating Systems Faqs

Sybase Faq's

Download free e-books

All scripting Faq's

Oracle Faq's

All technical Faq's

Hasya-Vyang hindi kavite

HR, Car, Finance Faq's

Finance and Investment Faq's

All Freshers Resources

All Placement Papers

QA and testing Faq's

Sql Server Faq's

Interview Puzzles

Mainframes Faq's

Java Faq's

Sap Faq's