![]() |
|
![]() |
| LinkBack | Thread Tools | Display Modes |
| | #61 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 97) What is a compile module?[/b] a. A compiled module is a script containing a library of user-defined functions that you want to call frequently from other tests. When you load a compiled module, its functions are automatically compiled and remain in memory. You can call them directly from within any test. b. Compiled modules can improve the organization and performance of your tests. Since you debug compiled modules before using them, your tests will require less error-checking. In addition, calling a function that is already compiled is significantly faster than interpreting a function in a test script. |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
| | #62 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 98) What is the difference between script and compile module?[/b] 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"); |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
| | #63 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 99) Write and explain various loop command?[/b] a. A for loop instructs WinRunner to execute one or more statements a specified number of times. It has the following syntax:[/b] [/i] for ( [ expression1 ]; [ expression2 ]; [ expression3 ] )[/i] statement[/i] 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 )[/i] statement ;[/i] [/i] 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[/i] statement[/i] while (expression);[/i] [/i] 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); |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
| | #64 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 100) Write and explain decision making command?[/b] 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. [/b] |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
| | #65 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 101) Write and explain switch command?[/b] 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. |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
| | #66 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 102) How do you write messages to the report?[/b] a. To write message to a report we use the report_msg statement Syntax[/b]: report_msg (message);[/i] [/b] 103) What is a command to invoke application?[/b] a. Invoke_application is the function used to invoke an application. Syntax: [/b]invoke_application(file, command_option, working_dir, SHOW);[/i] |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
| | #67 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 104) What is the purpose of tl_step command?[/b] a. Used to determine whether sections of a test pass or fail. Syntax:[/b] tl_step(step_name, status, description);[/i] 105) Which TSL function you will use to compare two files?[/b] a. We can compare 2 files in WinRunner using the file_compare function. Syntax[/b]: file_compare (file1, file2 [, save file]);[/i] |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
| | #68 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 106) What is the use of function generator?[/b] 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. |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
| | #69 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 107) What is the use of putting call and call_close statements in the test script?[/b] 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. [/b] |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
| | #70 (permalink) |
| Senior Member Join Date: Mar 2006 Age: 25
Posts: 343
Thanks: 3
Thanked 15 Times in 14 Posts
Rep Power: 9 | Good Work Spoorthi ..[img]smileys/smiley32.gif[/img] Gr8 collection .. keep it going...[img]smileys/smiley32.gif[/img] |
| | |
| | #71 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 108) What is the use of treturn and texit statements in the test script?[/b] 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[/b] 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[/b] 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 )]; [/b] |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
| | #72 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 109) Where do you set up the search path for a called test.[/b] 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. [/b] |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
| | #73 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 110) How you create user-defined functions and explain the syntax?[/b] 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. [/b] |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
| | #74 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 111) What does static and public class of a function means?[/b] 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. |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
| | #75 (permalink) |
| Senior Member Join Date: Mar 2006
Posts: 4,793
Blog Entries: 2 Thanks: 9
Thanked 699 Times in 534 Posts
Rep Power: 108 | 112) What does in, out and input parameters means?[/b] 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. [/b] 113) What is the purpose of return statement?[/b] 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: [/b]return [( expression )];[/i] |
| | |
| The Following User Says Thank You to Spoorthi For This Useful Post: | AjayKumar.Kataram (22-11-08)
|
![]() |
| Tags |
| asked , interview , qanda , winrunner |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| More Interview Questions Here... |