Subscribe by Email

Friday, August 24, 2012

How do you invoke an application using TSL?

Test scripts of all the tests that are created via the winrunner are composed in a special programming language developed by the mercury interactive called the test script language or TSL. 
The generation of the test scripts in test script language (TSL) takes place while the recording of the test is in progress. Each line of the winnrunner test script that is written in TSL language is called a TSL statement and like in other languages each statement ends in semi colon. 
Most of the features of the TSL make it much like the C language but overall if we see, creating tests in TSL is quite easy as compared to writing tests in C. 

In this article we are going to discuss about how an application can be invoked using the TSL scripts.
- The TSL allows you to define a message in the test script of the test and have it delivered to the test results window through the winrunner. 
- For sending a message to the test results window, the below mentioned statement can be added in the test script:
Report_msg( message );
- The message may contain a variable, a string or a combination of both of them depending up on the desire of the user. 
- Applications can be started or invoked from a test script very easily. 
- The winrunner provides you a function for starting or invoking an application. - This function has been named as the “invoke_application” function. 
- The very presence of this function makes it quite easy for the testers to invoke the same or the other application that is being tested. 
- Mostly, it happens that you require to invoke the software application that is being test during the start up of the winrunner. 
- The application software that is being tested can be invoked very easily every time you start the winrunner software by just making an simple addition to the start up test that you are having at hand. 
- This addition is of the function that we discussed above i.e., the invoke_application. 
- The invoke_application can be added to the start up test and the application will be started by the winrunner.

(Startup tests or functions are those tests and functions which are run and executed by the winrunner before it starts running other main tests or functions. They mark the beginning of the winrunner testing.)

- If you are unable to add this statement to the test script of the start up test there is no need to worry as there is one more way for invoking the application being tested in winrunner.
-There is a “run” tab available in the test properties dialog box of the winrunner. 
- This run tab can also be used for invoking an application. 
- Clicking on this you can invoke the application at the beginning of some test run.
- If the run tab also fails then you have one more way of invoking the application being tested which involves the use of the system statement to start an application.
Now let us see what the syntax for the invoke_application function is, it has been stated below:
Invoke_application ( file, command_option, working_dir, show );

The explanation for the above function syntax can be given as following:
- The full path of the application software to be invoked is designated by the file.
- The command line options that are to be applied are designated by the command_option parameter.
- The working directory of the supplication software is designated by the work_dir.
- Lastly, what shall be the appearance of the main window of the application when it is open is designated by the show.

No comments:

Facebook activity