Subscribe by Email


Showing posts with label Statements. Show all posts
Showing posts with label Statements. Show all posts

Thursday, October 11, 2012

What is 4Test in Silk Test?


4test in silk test is a fourth generation language or 4GL which comes under the category of the object oriented languages. This fourth generation language has been developed especially for fulfilling the needs of the quality assurance professionals. 
The 4test language possesses some very powerful features that have been grouped in to 3 basic kinds of functionality as described below:
  1. A library of object oriented classes: This group of functionality includes object oriented methods as well as classes that can be used to specify interaction of a test case with the GUI objects present in an application.
  2. A library of built in functions: This group of functionality includes features that are used for performing the common support tasks.
  3. A set of statements, data types and operators: This group of functionality includes the features that can be used for introducing the logic as well as the structure to a data base that has been recorded earlier.
- Before the test scripts are created and run, an object repository containing the information regarding the application under test or AUT is to be used by the silk test classic. 
- This object repository consists of the descriptions of all the GUI objects that are present in the application under test or AUT. 
- The actions that are performed by the silk test on these GUI objects are recognized by the silk test based up on some methods as well as properties associated with the objects on which the actions have been performed. 
- After the identification, the actions performed are recorded and stored in the object repository using the 4test language for scripting. 
- There are several classes that are used by the 4test language and have been mentioned below:
  1. Active X classes
  2. Visual basic classes
  3. General core classes
  4. General web application classes
  5. Flex class reference
  6. Java classes
  7. .net classes
  8. Rumba class reference
  9. SAP class reference
  10. Silver light class reference
  11. Java AWT class reference
  12. Java swing class reference
  13. Win 32 classes
  14. WPF class reference
  15. Xbrowser classes
The 4test language comes with the following in built functions:
  1. Agent information functions
  2. Argument pass modes functions
  3. Application state control functions
  4. Array manipulation functions
  5. Character and string conversion functions
  6. Data type manipulation functions
  7. Data base functions
  8. Data driven functions
  9. Date and time manipulation functions
  10. Distributed processing functions
  11. Distributed results logging functions
  12. Exception handling functions
  13. File manipulation functions
  14. Java functions
  15. List manipulation functions
  16. Locale functions
  17. Numeric functions
  18. Operation system calls
  19. Product version information functions
  20. Password encryption functions
  21. Random value operations
  22. Registry operations
  23. Results file operations
  24. Run time status messages functions
  25. Script information functions
  26. Semaphores
  27. Set manipulation functions
  28. String manipulation functions
  29. SWT functions
  30. Timers time date information
  31. Web browser functions
  32. Windows information functions
  33. Date transformation functions
The 4test language comes with the following categories of keywords:
  1. Arg list call keyword
  2. Current file keyword
  3. Current path keyword
  4. Type info keyword
  5. Alias keyword in type declarations
Following types of statements are found in 4test language:
  1. Access statement
  2. Break statement
  3. Const statement
  4. Continue statement
  5. Critical statement
  6. Exit statement
  7. Do___ except statement
  8. For statements
  9. If statement
  10. Multi tag statement
  11. Parent statement
  12. Parallel statement
  13. Raise statement
  14. Rendezvous statement
  15. Reraise statement
  16. Select statement
  17. Setting statement
  18. Spawn statement
  19. Switch statement
  20. Return statement
  21. Tag statement
  22. Use statement
  23. With statement
  24. While statement


What is a Silk Test Automation Tool? How Silk Test works?


In this article the focus is up on the silk test automation tool and the way it works. 


What is a SilkTest Automation Tool

- Silk test is test automation tool developed originally by the “segue software’. 
However, later on, this software firm was acquired by the “Borland” in the year of 2006. 
- Again, this Borland software firm was acquired by a third company by the name of “micro focus international” in the year of 2009. 
- This test automation tool was developed for the testing of the enterprise applications via the functional and regression testing methods. 

There are many different forms of silk test or we can say it provides the software world with many of its clients as described below:

  1. Silk test classic: This client of the silk test makes use of the domain specific language known as “4test” for scripting of the test automation scripts. This language just like the C++ language is an object oriented language. Just like C++ it also makes use of the Object Oriented concepts such as following:
a)   Inheritance
b)   Classes and
c)   objects
  1. Silk 4J: This client of the silk test enables one to follow test automation by using java as the scripting language in eclipse.
  2. Silk 4 net: This client of the silk test also enables one to follow test automation by using VBScript or sometimes using C# as the scripting language in the visual studio.
  3. Silk test work bench: This client of the silk test enables the testers to carry out the automation testing using VB.net as the scripting language as well as on a visual level.
The silk test automation comes with two major features which have been discussed below:

  1. Silk test agent: This feature of the silk test helps in translation of the script commands in to equivalent graphical user interface or GUI commands or we can even say in to user actions.The translated commands then can be run or executed on either the same machine or on a remote machine as a host.
  2. Silk test host: This feature takes hold of all the source script files.
- All the windows and controls of the AUT or application under test are identifiable with the silk test as objects. 
- Also, all the properties as well as attributes of each and every window can be defined by the silk test.
- Thus, we can say that the object oriented implementation is partially supported by the silk test. 
- The movements of the mouse as well as the key strokes can be identified by running the silk test automation tool. 
- This feature is particularly useful for the custom objects. 

The silk test can work for the following three programming methods that involve capturing of the dialogues:
  1. Record
  2. Play back and
  3. Descriptive programming
Many of the extensions are supported by the silk test and few of them are:
  1. .net
  2. Java swing
  3. Java swt
  4. DOM
  5. IE
  6. SAP windows GUI
  7. Firefox and so on.
- Bitview. Exe is the silk test bitmap tool that is used by the silk test for capturing as well as comparing the windows and areas.
- There are several file types that find their use in the silk test and have been mentioned below:
  1. Test plan (.pln)
  2. Test script (.t)
  3. Frame file (.inc)
  4. Result file (.res)
- According to a survey, the silk test provides the proper and right interface either IDE powered, script based or visual bases as it suits the role. 
- As a result, all the users are empowered to take participation in the testing process which ensures that there is a continuous validation of the critical applications. 


Monday, October 8, 2012

How many ways we can parameterize data in QTP?


Parameterization is one of the important provisions we have in quick test professional which has enabled the passing of the values to the tests very simple. This parameterization feature enables one to pass multiple values at a time to a test.
And what more? 
The process of parameterization has proven to be a great helping hand while carrying out the data driven testing. Data driven testing is the kind of testing that involves working with multiple sets of data on the same tests. 
The quick test professional comes with various ways for carrying out the process of parameterization:
  1. Parameterization via loop statements
  2. Parameterization via data table
  3. Dynamic test data submission
  4. Obtaining test data via front end objects
  5. Getting test data directly from the spread sheets, flat files or we can say external files.
  6. Getting test data directly from the oracle, MSaccess or we can say data bases.
Now we shall discuss the above 6 different ways of parameterizing the tests in detail.
1. Parameterization via loop statements
In this method the sequential numbers or logical numbers can be passed via the loop statements however you cannot pass strings to the tests.

2. Parameterization via data table: 
One data table or spread sheet is provided along every test in quick test professional. The provided data table along with the test can be used very well for the data driven testing. Furthermore the following 3 purposes are served by the data table:
a)   To import the test data from external spread sheets: for doing this open the data table and place the pointer. Then right click and select the import from file option. Then you need to enter the path of the spread sheet to be imported from and hit ok. Later connect to the test.
b)   To import the test data from the external flat files: for doing this open the data table and place the pointer. Then right click and select the import from file option. Then you need to browse the path of the file to imported and press ok. Later connect to the test.
c)   To import the test data from the data bases: for doing this the user needs to first create a DSN of the data base i.e., the data source name by making use of the SQL commands. This can be done by creating a test data base and saving the created data base with .mdb extension in msaccess. Next step involves creation of a data table and filling it up with data. The last step is to create a DSN and you can start importing the data.

    3. Dynamic test data submission: 
   This also involves the use of the loop statements however the data has to be entered again and again by the user.

    4. Obtaining test data via front end objects

   5. Getting test data directly from the spread sheets, flat files or we can say external files.

   6. Getting test data directly from the oracle, MSaccess or we can say data bases.

There is one more method for parameterizing the data apart from those mentioned above and is also less followed. The method makes use of the dictionary object for the purpose of parameterization. There are several types of parameterization namely:
  1. Data table
  2. Environment variable
  3. Random number
  4. Test and action
The data table consists of the following parameters:
  1. Input parameter
  2. Out put parameter
  3. Random number
  4. Environment variable. 


Tuesday, September 4, 2012

What are User Define Functions? What are all the different types of User defined functions? (In WinRunner)


The testing capabilities of the winrunner can be extended further by letting the user create his own TSL functions. The TSL functions thus created can be used in a compiled module as well as in a test. 

Apart from just providing the built in functions, the TSL allows you to do the following:
1. The user defined functions can be defined by the user. After defining the function once in the test script, it can be called from anywhere in the tests.
2. The user defined functions can be defined by the user for compiled modules. Once that particular gets loaded, the functions it holds can be called from anywhere.
3. These user defined functions can be called from anywhere in the Microsoft API and other external DLL functions as well.

- The user defined functions are used when it is required to perform the same operations several number of times. 
- Instead of repeating the same code again and again, a single function can be written that will perform the same operations a number of times. 
- This has the following benefits:
  1. It makes your test scripts more modular.
  2. It makes your test scripts more readable.
  3. It becomes easier to maintain the code and debug it.

What are User Defined Functions?

- A user defined function because of being incorporated in to the compiled module can be accessed from any where. 
- At the same time the time taken for the execution is reduced since the compilation of the function is done in the earlier stages only. 
- Below stated is the typical declaration for a user defined function:
[class] function name ( [mode]  parameter.... )
{
Declarations;
Statements;
}
- The class of the function can either be public or static. 
- Whenever a static function is declared with static class it is made available to the module or the test within which that function lies. 
- Once a function with a public class is executed, it is made available to almost all the tests for the time till the test holding that function remains open. 
- This seems to be the most convenient option when it is required that the function should be accessible from all the tests. 
- However if the case is as such that it is required that many tests should be able to access the function, then the function has to be placed in a compiled module. 
- Whenever a function is placed in the compiled module, it becomes accessible until the duration of the testing session ends. 
- Unlike the class, there is no need of declaring the parameters explicitly. 
Parameters can possess any one of the following modes:
  1. In: in this mode the value is assigned from outside the function.
  2. Out: in this mode the value is assigned from inside the function.
  3. Inout: in this mode the value can assigned either from inside or from outside the function.

Types of User Functions in WinRunner

Now let us state all are the types of user defined functions:
  1. Scalar functions
  2. Multi- statement table valued functions and
  3. Inline table valued functions
- A user defined function may consist of either zero parameter or more then that.
- The function may return either a table or a scalar value.
- However, the input parameters have a limit of 1024. 
- If the function is to be driven with the default values then the key word DEFAULT must be specified while you call the function. 
- This key word is added in order to get a default value for the user defined functions. 
- In some cases if you omit the parameters then the parameters are treated to be default values. 


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 is a Module? What is a Compiled Module? (In WinRunner)


Modules are the basic elements of any software system or application that make up the foundation of that software system or application. In winrunner usually the term “compiled module” is used. We shall see in this article that what are the compiled modules and how they can be created in winrunner. 

What are Compiled Modules?

- Compiled modules store the frequently used functions and so are considered to be a kind of libraries. 
- In compiled modules, the functions defined by users i.e., the user defined functions can be stored and later these stored user defined functions can be called from the test scripts. 
- Compiled modules are considered to be a library since they are actually a script containing all the user defined functions which are required to be called many times from other tests. 
- Whenever a compiled module is loaded, the functions that it contains are subjected to automatic compilation and reside in the memory itself. 
- After this, they can be called directly and from within any test. 
- With the compiled modules, the performances as well as the organization of the tests that you create are improved significantly.
- This happens so because the compiled modules are debugged before they are used and therefore the tests that we created require very less error- checking. - In addition to all this, the interpretation of a function in a test script is quite slower than the calling of a function that has already been compiled.

There are 2 ways available for compiling a module as mentioned below:
  1. Loading the module to be compiled from a test script with the help of the TSL load function.
  2. Running the script of the module to be compiled with the help of the winrunner run commands.
- The step commands can be used for performing the incremental compilation if in case you need to debug or modify an already existing module. 
- After this, the part of the compiled module that you made changes to needs to be run so that the entire compiled module will be updated. 
- It is necessary that the user defined functions present in your compiled modules are automatically compiled every time the winrunner starts up. 
- For this you need to add load statements top the start up tests. 
- However, you should know that for loading the recovery compiled module there is no need for adding the load statements to the start up tests or any other tests.
- This is so bacuse the recovery compiled module loads by itself when the winrunner is started. 
- Another point to be taken care of is that the compiled modules cannot load the GUI map files when you are working in the GUI map file per test mode.
- If the compiled module has to make references to any of the GUI objects present in the application software then it is required that the referred GUI objects must also be referred in the test which is responsible for loading that particular compiled module. 
- Like a regular TSL test the compiled module can be opened, edited or saved.  - However, there is a big difference in the contents of a compiled module or ordinary tests. 
- Like a regular test, a compiled module does not contain any analog input or check points. 
- This is so because a compiled module is designed to store user defined functions rather than just performing a test. 
- The purpose why it stores all the frequently user defined functions is to speed up the execution process by providing a quick and convenient access from the other tests. 
- Its contents are:
  1. Function definitions and declarations,
  2. External functions prototypes
  3. Load statements etc. 


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. 


Facebook activity