Quality Testing

Quality is delighting customers

How to create compile module file and load to winrunner ?

Please explain with example

Views: 53

Replies to This Discussion

Hi Aanya!
A Compile Module is a script containing a library of user-defined functions that one wants to call from other scripts or test runs.
When you load a compiled module, its functions are automatically compiled and remain in memory.

Test run can call those functions directly from within test.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.
The script should be saved as compiled module.
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.
While winrunner is launching use Start up to run the project automatically .
***Create new test in winrunner::File Menu-->New Test
***Create GUI Function::New Test--->Here write GUI function-->Save it.
***After Saving Create Compiled Function Module-->File Menu-->Test Properties--->general Tab-- >Test type:change main test to compiled module-->Apply and Ok.
***Then load to winrunner:: We can load that function using LOAD Function.
***Syntax:: ""Load("funtion",0/1,0/1);""
First 0 indicates userdefined file
First 1 indicates system defined file
Second 0 indicates Appearance of function while running
Second 1 indicates Disappearance of function while running.
*** Load to winrunner process:: Winrunner window-->Tools menu-->genral options-->Start up--
>Browse previously saved Compiled module-->ok.
________ JAY _______
About Compile Module:
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.

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

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

e) 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" );

f) 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");

Jay can you clarify my answer please ...?
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" ] ] );

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2021   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service