Subscribe by Email


Showing posts with label Test Script Language. Show all posts
Showing posts with label Test Script Language. Show all posts

Friday, August 31, 2012

What is TSL? What 4GL is it similar too?


TSL and 4GL are two major languages that are coming in to the scenario of the present world programming languages. What do you mean by a test script actually? 
Test scripts form a set of instructions that in turn can be performed on some software system or application under test for checking whether or not the functions are giving the desired output i.e., if they are working properly or not. There are two ways via which these test scripts can be executed as mentioned below:
  1. Manual testing and
  2. Automated testing
In this article we shall discuss regarding the test script language or TSL and fourth generation language or 4GL. First let us start our discussion with the test script language. 

About Test Script Language

- The Test script language lies at the heart of the integrated testing environment created by the mercury interactive.
- Test script language is categorized under the category of high level languages. 
- Its usefulness is born out of the combination of the flexibility as well as the power of the conventional programming languages and functions that have been developed as a tool or a feature to be used along with the products of the mercury interactive like winrunner and test director. 
- Also, this feature of the test script language has made it to be used for the modification and programming of the sophisticated test suites. 
- The functions that the test script language provides have been grouped in to the following four categories:
  1. Analog functions
  2. Context sensitive functions
  3. Customization functions and
  4. Standard functions.
- All of the above mentioned functions do not come with all the mercury interactive products. 
- Winrunner is one such mercury interactive product which supports all of these functions. 
- Apart from just the built in functions the test script languages gives its users the provision of creating their own functions.

What are Fourth Generation Languages - 4GL?

- A fourth generation programming language needs not necessarily be a language only it can also be a programming environment. 
- The 4GLs have been developed with a certain set of design patterns in mind and are assigned a specific problem domain. 
- 4GLs were developed as a succession to the 3GLs and are known to define a higher trend of statement power as well as abstraction. 
- It was observed that the 3GL languages were quite slow and much prone to errors. 
- As a result of the efforts to overcome this problem, the 4GL languages were born and these were more focussed towards aspects like:
     1. Systems engineering
     2. Problem solving and so on.
- The fourth generation language was designed as such that they cut down on the following: 
     1. programming efforts,
     2. Time consumed in development and of course
     3. The cost of the software development.

- However, in some of the cases, a try at achieving all this resulted in an ineffective and unmanageable code. 
- A formal definition of the 4GL was given by John Capers in terms of developer productivity (i.e., in terms of function points per staff month). 
- 4GL languages are said to support 12- 20 function points per staff month. 
- The 4GLs are a subset of domain specific programming languages has been stated a number of times by some researchers. 
- 4GLs have been classified in to 4 types as stated below:

1.Table driven programming (codeless): Uses table driven algorithm. Example: power builder.
2. Report generator programming languages: Generates the required report.
3. Fourth generation environments or more ambitious 4GLs: Specialize in generation whole system from output of CASE tools.
4. Data management 4GLs: such as-
             a)   SPSS
             b)   SAS
             c)   Stata


Thursday, August 30, 2012

What are the other codes you can write/call with in TSL?


TSL or test script language is the sole language of the winrunner i.e., it is the only language in which the winrunner test scripts are generated. One requires a deep knowledge of TSL so as to create highly sophisticated test scripts. 

A good knowledge of the language also cut downs on the need of the manual intervention. A small number of keywords and operators make the TSL language quite compact. Proficiency in languages like C and C++ will make it easier for you to deal with TSL language. 

The TSL language being a script language has a very simple syntax structure when compared to other programming languages. This feature of TSL adds to its both advantage and disadvantage. The advantage is that it is as easy as a wink to learn because of a less complex structure and the disadvantage is that being so simple reduces its capabilities. 

Below mentioned are the features of the TSL language that can be used to write the code:
  1. Comments
  2. Naming rules
  3. Data types
  4. Data storage
  5. Operations
  6. Branching
  7. Functions and
  8. Loops.
Knowledge of other languages like following also adds in quick learning of TSL:
  1. Java
  2. Perl
  3. JavaScript etc.
- The QTP codes that are written using the HP’s quick test professional can be written or called in TSL language also. 
- The reverse is also possible i.e., the code written in TSL can be migrated in to QTP format. 
- The other codes thus written using TSL language usually sever less time turnaround but it largely depends on the degree of the complexity of the code as well as the process.
- Winrunner provides a shareable environment in which users can organize, write and maintain a set of automated test cases as well as supporting software libraries. 
- The winrunner along with TSL provides a perfect tool box for the creation of a testing frame work but the responsibility to build the right frame work lies in the hands of the user. 
- Winrunner provides a good software development environment that caters to all the needs of the test automation engineers. 
- The TSL can be considered to be a simplified version of C language or one of its derivatives since it does looks and feels like C language. 
- Test automation engineers who are quite experienced with C take less time and face little difficulty in becoming proficient with TSL language. 
- The organization of the TSL code depends largely up on the skills of the test automation engineers. 
- They must organize and maintain the code base.
- The winrunner comes with a large number of automation wizards which aid in every process of test automation. 
- Even though the winrunner meets all the needs of the testing organization, it is required that an additional development paradigm and testing frame work must be implemented with it. 
- This is necessary because otherwise the values obtained from the test automation will be lost in the due course of maintenance.
- The web, GUI, .NET and java codes can be written and called with in TSL and can also be verified. 
- TSL language is a standard start up script that is easily invoked during the start up of the winrunner. 
- The TSL codes are used for the standardization of several operational aspects of the winrunner like the following:
  1. Standard functions
  2. GUI map configurations
  3. Shared scripts
  4. Shared libraries and so on.
- There are a hundred functions that TSL provides for various uses categorized under various groups and categories namely:
  1. Analog
  2. Context sensitive
  3. Customization and
  4. Standard.


Wednesday, August 29, 2012

What are all the different languages that can be called using TSL in between the scripts?


A suite of manual test cases was developed by some of the organizations with the help of text editor which was found to be quite difficult to be used, maintained and executed as efficiently as in the case of other test cases. 
These test cases prove to be quite effective in detecting the defects before the production phase starts but consume more time in their management and execution and thus affect the investment terribly.
This problem becomes graver as the role of the organizations grows. The only solution to this problem is the investment in a sound test automation tool. 

Winrunner is such a test automation tool whose core language is the TSL or “test script language”. 
The three basic needs of the test automation engineer are addressed by the winrunner and TSL both namely:
  1. Management and organizational needs
  2. Test architecture
  3. End user

What are the features of WinRunner?

The winrunner possesses the following features:
  1. It enables the users to author, organize and maintain a set of automated test cases.
  2. Provides a web enabled and shareable environment.
  3. It supports test case design.
  4. Provides automation
  5. Supports execution of the best practices (that have been defined the test organization).
  6. It serves as a tool box for building a testing frame work.
All the facilities are provided by the winrunner, now the responsibility of building a test frame work lies solely with the test automation engineers. 

What is TSL? What languages can be called through TSL?

- Winrunner is driven by the test scripts created in the language TSL.
- Test script language is a programming language which is quite close to the C programming language.
- Most of the features of the test script language resemble the features of the C programming language though it is quite simple than C programming language.
- The test automation engineers who are quite experienced with the languages such as C do not find it much difficult to master the test script language. 
- The organization is responsible for the maintenance and organization of this TSL code base.
- Few of the different languages that can be called using the test script language in between the scripts are:
  1. Web scripts
  2. GUI
  3. >NET
  4. Java
  5. Javascript
  6. HTML and so on.
- With the test script language the integration of other tool sets is also possible and is done via some API. 
- TSL actually comes in to play whenever the user records a test. 
- The default code that is generated in the winrunner window is in test script language only. 
- This script written in test script language is saved as some script file. 
- The TSL language apart from just creating the test scripts also combines functions developed from some specific purpose for the test in some other language that has got TSL like features like control flow statements, variables, arrays and user defined functions.
- Another good thing about test script language is that there is no need to compile it. 
- The scripts can be immediately executed just after they have been recorded. - Four types of functions are provided by the test script language as stated below:
  1. Analog functions
  2. Context sensitive functions
  3. Standard functions and
  4. Customization functions.
- Not even just language codes and functions but also the whole application written in a different language can be invoked in between the scripts with test script language.  
- This is actually done via the function “invoke_application” that is defined using test script language only. 


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.  


Wednesday, July 21, 2010

Test Scripting Language : 4Test used in SilkTest

SilkTest is Segue Software’s offering for automated functional testing. It supports the testing of client-server and browser-based applications, as well as standalone programs.
- In SilkTest, users modify automated test scripts using a proprietary, object-based programming language called 4Test.
- 4Test is an object oriented 4GL language and offers sufficient built in functionality to ease our life.
- SilkTest scripts can also directly access databases to execute SQL commands and perform verification of database content.

There are basically four classes to which the methods belong:
- AgentClass
- AynWin
- ClipboardClass
- CursorClass
Important Methods in test scripts are :
- Accept (): closes the dialog box and accepts values specified there.
- ClearText (): removes all text from text field.
- Click (): Clicks a mouse button on the push button.
- Close (): Closes the window.
- Close Windows (): Closes all windows of the application except main.
- Exit (): Terminates the application.
- GetActive (): Returns the active window in the application.
- GetCloseWindows (): Returns the windows that must close to return the application to base state.
- GetFocus (): Returns the control with the input focus.
- Invoke (): Invokes the application.
- SetActive (): Makes the window active.
- Wait (): Waits for the specified cursor and returns the value of elapsed time.
- VerifyActive (): Verifies that the window is active.
- Start (): Invokes the application and waits for the main window to appear.
- Size (): Resizes the window.


Tuesday, July 20, 2010

Parts and General Syntax Rules of Test Script Language (TSL)

TSL stands for Test Script Language. It is created by Mercury Interactive.

Syntax Rules of TSL


- Semi‐colons mark the end of a simple statement.
- Statements that contain other statements are called compound statements. Compound statements use curly braces and not semi‐colons.
- TSL is a case sensitive language. You need to be extra careful with the case of the statements. Most of the identifiers, operators and functions within the language utilize lower case so use lower case when you are not sure.

What Constitutes TSL?


Comments :
Use a # symbol to write a comment. Statements written as comments are ignored by the interpreter. It makes easier for the reader of the test script with useful information about the test. TSL does not have multi‐line comments.
Naming Rules :
Every language has rules that define what names are acceptable in the language and which names are not. Naming rules of TSL are :
- Must begin with a letter or the underscore.
- Cannot contain special characters except the underscore.
- Cannot match a reserved word.
- Must be unique within a context.
- Case Sensitive.
Data Types :
When a script is executing, different kinds of data gets stored. TSL simply uses the context in which we access the data to determine what the data type is. There are two data types in TSL:
- String : stores alphanumeric data.
- Number : Stores numeric data.
Data Storage :
This refers how information is stored in the test during test execution. TSL uses three different types of storage vehicles. These include :
- Variables : for dynamic storage.
- Constants : for fixed values.
- Arrays : for sets.
Variables :
Variables are used to capture the information that is to be needed later to be stored temporarily. In TSL, variable declaration is optional so you can create a variable simply by using the variable in your code. The only exception to this is in functions.
Constants :
Constants are very similar to variables because they store values also. The major difference between these two is that the value of a constant is fixed and cannot be changed during code execution.
Arrays :
Arrays are used to store several pieces of related data such as names. TSL provides a better mechanism for use when dealing with a collection of similar items. This concept, known as arrays, allows you to store several values of related information into the same variable.
Operations :
Operations are the many forms of computations, comparisons etc that can be performed in TSL. The symbols used in an operation are known as operators and the values involved in these operations are known as operands.
Branching :
Branching statements allow your code to avoid executing certain portions of code unless a specified condition is met. TSL uses two kinds of branching statements i.e. the if statement and the switch statement.
Loops :
Loops provide the ability to repeat execution of certain statements. These statements are repeatedly executed until an initial condition evaluates to false. TSL supports four different types of loops and these are the while, do..while, for and for..in loops.
Functions :
Functions are blocks of code containing one or more TSL statements. These code blocks are very useful in performing activities that need to be executed from several different locations in your code. TSL provides many built in functions as well as provides you the ability to create your own user‐defined functions.


Sunday, July 18, 2010

Test Script Languages (TSL)

Test Script Language(TSL) is a scripting language with syntax similar to C language. TSL is the script language used by WinRunner for recording and executing scripts.

Features Of TSL :
- The TSL language is very compact containing only a small number of operators and keywords.
- TSL is a script language and as such, does not have many of the complex syntax
structures you may find in programming languages.
- On the other hand, TSL as a script language has considerably less features and capabilities than a programming language.
- Comments : Allows users to enter human readable information in the test script that will be ignored by the interpreter.
- Naming Rules : Rules for identifiers within TSL.
- Data Types : The different types of data values that are supported by the language.
- Data Storage : Constructs that can be used to store information.
- Operations : Different type of computational operations.
- Branching : Avoids executing certain portions of the code unless a condition is met.
- Loops : Repeats execution of a certain section of code.
- Functions : Group of statements used to perform some useful functionality.

There are four categories of TSL functions. Each category of functions is for performing specific tasks. These categories are as follows:
- Analog Functions
These functions are used when you record in Analog mode, a mode in which the exact coordinates of the GUI map are required. When you record in Analog mode, these functions are used to depict mouse clicks, keyboard input, and the exact coordinates traveled by the mouse. The various analog functions available are Bitmap Checkpoint Functions, Input Device Functions, Synchronization functions, Table Functions, Text Checkpoint Functions.
- Context Sensitive Functions
These functions are used where the exact coordinates are not required. In Context Sensitive mode, each time you record an operation on the application under test (AUT), a TSL statement is generated in the test script which describes the object selected and the action performed.
- Customization Functions
These functions allow the user to improve the testing tool by adding functions to the Function Generator. The various customization functions are custom record functions,
custom user interface functions, function generator functions and GUI checkpoint functions. Different context-sensitive functions are Active Bar Functions, ActiveX/Visual Basic Functions, Bitmap Checkpoint Functions, Button Object Functions
Calendar Functions,Database Functions, Data – driven test Functions,GUI related Functions etc.
- Standard Functions
These functions include all the basic elements of programming language like control flow statements, mathematical functions, string related functions etc. The various standard functions are arithmetic functions, array functions, call statements, compiled module functions, I/O functions, load testing functions, operating system functions, etc.


Facebook activity