Vous êtes sur la page 1sur 4

Programming with TSL 1.What are the four types of TSL function?

Context Sensitive functions Analog functions Standard functions Customization functions 2.What is TSL? TSL is a C-like programming language designed for creating test scripts in WinRunner. 3.How do you specify comments in TSL? # Sign is uses to specify comments in TSL. 4.Is TSL case sensitive? Yes, TSL is case sensitive. 5.What is report_msg used for? A report_msg statement is used to display the value of the text variable in a report. 6.What are 3 looping statements used in TSL? For Loop While loop Do / While Loop 7.What are the decisions making statements used in TSL? If / Else statement Switch statement 8.What is the purpose of using invoke_application and give its syntax? The invoke_application statement is used to invoke an application, which is to be tested. Syntax: invoke_application (file, command_option, working_dir, show); 9.What is the purpose of tl_step statement? The tl_step statement is to determine whether sections of a test pass or fail and return the status to the test results. Syntax: tl_step (step_name, status, description); 10.How do you compare two files in TSL? To compare two files in TSL use file_compare statement.

Syntax: file_compare ( file_1, file_2 [,save_file ] ); 11.What is a Function Generator? Function Generator is WinRunners visual programming tool, which is used to add functions to your test scripts. 12.What is the difference between a call and a call_close statement? 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. 13.What is the difference between a treturn and texit statement? 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. 14.How do you set the search path for a test using TSL? The search path is set using a TSL by adding a setvar statement to the test script. 15.Do you need to explicitly declare a function parameter? No. 16.What are the different modes of a function parameter? a). In mode. b). Out mode. c). Inout mode. 17.What does a return statement do? The return 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. 18.What does a return statement return to the calling function or test when no expression is assigned to it? When no expression is assigned to the return statement, an empty string is returned to the calling function or test. 19.How does a Compiled Module differ from an ordinary test script? Compiled Module cannot include checkpoints or any analog input such as mouse tracking whereas an ordinary test scripts can include all these. 20.What is a Compiled Module? Compiled Module is like regular script, which is not used to perform a test, but to store functions that are used most frequently so that they can be quickly and conveniently accessed from other tests. 21.How do you load a Compiled Module?

Compiled Module is loaded using a load statement. 22.How do you unload a Compiled Module? Compiled Module is unloaded from the memory using a unload statement. 23.What is the purpose of a reload statement? The reload function removes a loaded module from memory and reloads it (combining the functions of unload and load). 24. How do you load a 32-bit Dll using TSL? The TSL function load_dll is used to load a 32-bit Dll. 25.How do you load a 16-bit Dll using TSL? The TSL function load_16_dll is used to load a 16-bit Dll. 26.How do you unload a 32-bit Dll using TSL? The TSL function unload_dll is used to unload a 32-bit Dll. 27. How do you unload a 16-bit Dll using TSL? The TSL function unload_16_dll is used to unload a 16-bit Dll. 28.How do you declare external function using TSL? The extern statement is used to declare an external function using TSL. 29.Can you define the scope of an Auto variable? 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. 30. Can you define the scope of a Static variable? 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. 31.Can you define the scope of a Public variable? A public variable can be declared only within a test or module, and is available for all functions, tests, and compiled modules. 32.What does an Extern declaration indicate? An extern declaration indicates a reference to a public variable declared outside of the current test or module. 33.What does the TSL create_input_dialog do? The create_input_dialog creates a dialog box with any message you specify, and an edit field. The function returns a string containing whatever you type into the edit field, during an interactive run. 34.What does the create_list_dialog TSL statement do?

The create_list_dialog creates a dialog box with a list of items, and your message. The function returns a string containing the item that you select during an interactive run. 35. What does the create_custom_dialog TSL statement do? The create_custom_dialog creates a dialog box with edit fields, check boxes, an execute button, and a Cancel button. 36.What does the create_browse_file_dialog statement do? The create_browse_file_dialog displays a browse dialog box from which the user selects a file. During an interactive run, the function returns a string containing the name of the selected file. 37. What does the create_password_dialog statement do? The create_password_dialog creates a dialog box with two edit fields, one for login name input, and one for password input. 38.What is the purpose of using setvar statement? The setvar function is used to set the value of a testing option from within the test script. 39.What is the purpose of using getvar statement? The getvar function is used to retrieve the current value of a testing option.

Vous aimerez peut-être aussi