Subscribe by Email

Sunday, August 19, 2012

How do you program tests with Test Script language (TSL)?

The tests that are created by the winrunner are composed of the statements that have been coded in a special language by the mercury interactive called Test Script Language or TSL in short form. 
- The tests created can be further enhanced by using the TSL language.
- Remember, this feature which allows the modification of the test scripts via the TSL language is not available in the winrunner runtime.
- The generation of TSL statement takes place whenever a test is recorded by the winrunner. 
- Each line of the test generated by the winrunner is called a TSL statement and is as usual followed by a semi colon like in many other programming languages.
- Each and every TSL statement consists of some user input like mouse click or input from key board to be fed to the software system or application that is to be tested. 
- The length of the TSL statement varies from line to line of the test script. 
- TSL can be thought of more like the C programming language that has been designed for the creation of the test scripts. 
Some certain specific functions like those mentioned below are combined by the TSL:
  1. Variables
  2. Control flow statements
  3. User defined functions
  4. Arrays and so on.
- A recorded script can be further enhanced just by typing the programming elements in to the winrunner test window.
- However, the TSL proves to be quite useful when compared to C because in test script language there is no need of compilation of the written code. 
- The test is just written or recorded and immediately subjected to execution. 
Four types of functions constitute the TSL:
  1. Analog functions
  2. Context sensitive functions
  3. Customization functions and
  4. Standard functions.

How TSL can aid in the creation of tests?

- The tests developed using TSL are basically of descriptive nature and thus this type of programming is called the descriptive programming. 
- A logical name is assigned to an object the very moment it is added to the GUI map. 
- Once a GUI object makes its place in the GUI map, it becomes quite easy for you to add any TSL statements to it. 
- The logical name that is given to the object is as such that it gives a description of the GUI object. 
- During the execution of the tests, the objects are discovered based on their logical names itself but for the identification other property values that are stored in the map are used. 
- These logical names of the GUI objects can be further modified so that it becomes quite easy for you for the identification of the tests. 
- While programming with TSL, the statements that perform functions on objects can also be added without making a reference to the GUI map. 
- But doing that requires entering some more information regarding the description of the object so that it can be uniquely identified during the test run. 
- This is the essence of the descriptive programming using TSL. 
- While doing the programming, if you forget which values and properties of the object were to be identified you can take help of the GUI spy for viewing the current properties of the object as well as its values. 
- Stress conditions can also be created while programming with TSL which are designed for the determination of the limitation of the software system or application. 
- Stress conditions can be created by creating a loop that executes a block of TSL statements for number of times specified by the user.  

No comments:

Facebook activity