How do you declare constants?
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 we exit WinRunner.
The syntax of this declaration is :
[class] const name [= expression]; Reply
What does auto, static, public and extern variables means?
> 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.
> 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.
> Public : A public variable can be declared only within a test or module, and is available for all functions, tests, and compiled modules.
> Extern : An extern declaration indicates a reference to a public variable declared outside of the current test or module. Reply
What is the use of treturn and texit statements in the test script?
The treturn and texit statements are used to stop execution of called tests.
> The treturn statement stops the current test and returns control to the calling test.
> 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. 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.
The syntax is :
treturn [( expression )];
texit [( expression )]; Reply
What is the use of putting call and call_close statements in the test script?
We can use two types of call statements to invoke one test from another :
> A call statement invokes a test from within another test.
> A call_close statement invokes a test from within a script and closes the test when the test is completed. Reply
What is the use of function generator?
The Function Generator provides a quick, error-free way to program scripts. We can :
> Add Context Sensitive functions that perform operations on a GUI object or get information from the application being tested.
> Add Standard and Analog functions that perform non-Context Sensitive tasks such as synchronizing test execution or sending user-defined messages to a report.
> Add Customization functions that enable we to modify WinRunner to suit our testing environment. Reply
Which TSL function you will use to compare two files?
We can compare 2 files in WinRunner using
> The file_compare function.
Syntax : file_compare (file1, file2 [, save file]); Reply
What is the purpose of tl_step command?
Used to determine whether sections of a test pass or fail.
Syntax : tl_step(step_name, status, description); Reply
What is a command to invoke application?
Invoke_application is the function used to invoke an application.
Syntax : invoke_application(file, command_option, working_dir, SHOW); Reply
How do you write messages to the report?
To write message to a report we use the report_msg statement :
Syntax : report_msg (message); Reply
What is the difference between script and compile module?
Mny diff are there :
> Test script contains the executable file in WinRunner while Compiled Module is used to store reusable functions. Complied modules are not executable.
> WinRunner performs a pre-compilation automatically when it saves a module assigned a property value of Compiled Module.
> 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( "C:\MyAppFolder\" & "app_init" );
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"); Reply