Saturday 16 August 2014

QTP For POS Regression Testing


1.    Introduction:

QTP (Quick Test Professional) is an automated testing tool which can be used for web based and GUI (Graphical User Interface) applications. QTP uses VB Script for programming.

Testing each step one by one by manual method needs lot of man power and also consumes lot a time. Also there are chances to miss few features during testing.But using QTP we can generate the scripts automatically which actually records each step when the user performs and later allows us to run these test cases and also modify them if there are any further changes with little effort.


2.    Framework Features:

The framework has following features:
a.    Script
Scripts are generated by recording the typical actions which user performs in the application.
b.    Function Library:
Creating function libraries involves developing customized functions for the application we want to test.This enables us to create keywords that perform operations that are not normally available for use with a particular test object class. This is basically a vbs (Visual Basic Scripting) file with the custom defined functions. The functions used are:

·         Launch_POS- Function used to launch the POS application
·         Authenticate (Role for the user) - Function used to perform authentication in the POS application based on the Role provided. Role can be either Manager or Sales. It picks up the login credentials from the environmental variables.
·         Close_POS- Closes the POS application.
·         Write_Result- This function is called by each and every script at the end of the execution. It writes the test results to a text file.

c.    Environment Variables:
Variables which are common across all the scripts are used as environment variables. Few variables for reference:
·         POS Manager UserID
·         POS Manager Password
·         POS Sales UserID
·         POS Sales Password
Any changes to the above variable values will require the user to open the xml file in the “Environment Variable” folder and make the changes to the values and save the value. The scripts will automatically pick the new values.
Local variable: Local to the actions. It is used within the action in a test.
Global variable: used across many actions in a test.
d.    Parameterized Values:
Parameterized data is provided in the Global sheet of every script. To make any change in the test data, the user needs to open the script and change the appropriate parameter data.
e.    Object Repository
This is used for each script to add some additional objects.
f.     Views in QTP:

There are two views in QTP:

·         Expert view
·         Keyword view

Expert view has the VB script for the test cases.
Keyword view has the graphical representation of the objects used in the script.

In the keyword view we can add steps (using insert->add step) and in expert script we can modify the scripts accordingly. There are two panes below: Global and Action1.The Global pane contains the variables used for all action scripts.Action1 pane contains the variables used for that particular action.

3.    Recording and Running:


Quick Test records each step which the user performs in the application and generates the script, which actually forms the main content of the test case. We can then add conditions (like if/for/while) accordingly and design the final script to be executed.

Ø  Automation > Record and Run Settings > Java
Ø  Select ‘Open the following application when a record or run session begins’
Ø  And select Executable File under Application Details





Once done, record the operations done in the test case. Automation > Record
Start the ORPOS application and perform all steps that need to be done for the test case. Once the record session is done, we can view the script generated for the test case under expert view


We can add object using object repository. To add objects, click add object. (Application should be active) click on the object on the application to get it added.





For example to add constrained password field, click on that prompt and response panel and it gets added

To add application, click on title bar of the POS application.





Actions performed in the application can be recorded to generate the scripts. The scripts can be executed later by running the test cases.


Add-ins used:
·         QTP X.X
·         Oracle, Java, Web, ActiveX add-ins are required to be installed along with the QTP installation.


4.    Script Execution:
Scripts can be executed in either single script mode or batch mode.
Single script - Steps are:
a.    Launch QTP application with the add-ins installed.

b.    Click on the Open button.

c.    Browse through files to select the script you want to run.

d.    Once the script loads completely, hit on Run.

e.    Once the script completes execution, the test result comes up automatically.

f.     Scripts that are generated during recording are executed when we run the test cases. QTP also prompts for input in case any parameters are defined and it also generates a test case result report once execution is completed.

g.    If our test contains a global Data Table parameter, Quick Test runs the test once for each row in the Data Table.

h.    If our test contains a Data Table parameter for the current action data sheet, Quick Test runs the action once for each row of data in that action data sheet.

i.      We can also specify whether to run the first iteration or all iterations, for the entire test or for a specific action in the test; or to run the iterations for a specified range of data sets.





Batch mode:
Steps:
a.    Go to Start->All Programs->Quick Test Professional->Tools->Test Batch Runner.
b.    Click on the Add Button
c.    Browse to the test script folders and select the test cases which you want to run.
d.    After you are done, click on the Run button
e.    Test Batch Runner will automatically launch QTP, and load the scripts one by one in a sequential manner and execute.
f.     Test results will be published in a text file.


5.    Advantages:

·         The application is built in a robust manner which enables updating the scripts for any further changes with minimal effort and changes to the actual automation process.

·         To avoid errors during execution, then scripts will first perform sale transactions and then proceed. For example, in the case of the scripts involving Return transactions, the script will first perform a sale and use the transaction details of the sale just performed for the return.

·         As the test cases are End to End (E2E), they usually require a Sale transaction to be performed in POS and an inventory check thereafter in EBS. As a result, our automation scripts have a tight coupling between POS and EBS.

·         To minimize the need of manual intervention, for serialized items the serial numbers available in the inventory are picked up at run time by the script and used in the transaction. This enables the user to run the scripts again and again eliminating the need to manually feed in the serial numbers.
Also it is necessary to see that sufficient a quantity of items is available in stock to avoid errors during execution.

6.    Limitations:

1.    POS version change: for version change, the label in the application gets updated to the new version. So the object in the object repository has to match the latest application state.
2.    POS time out exceptions/Service Communication failure which occurs sometimes may cause issues during execution as this is not handled in scripts.
3.    Scenarios like inventory checks are also not checked using scripts

7.    Conclusion:
Hence QTP has the following advantages in automating the scripts:
Robustness- The framework is very robust which enables updating the scripts for any further changes with little effort.

Script Portability- The scripts can be copied and deployed in any QTP machine without any impact. As relative paths have been used wherever applicable, the folder containing the scripts can be copied

2 comments :

Hello,
The informative Article on QTP For POS Regression Testing is very good is explained . It give detail information about it .Thanks for Sharing the information on Regression testing. Software Testing Company

Excellent article!!! LoadRunner is popular automation testing tool used for validating a software application/system under load. It delivers most precise information about the performance, functionality and behavior of the software product.
Regards:
Loadrunner Training in Chennai |
Qtp training

Post a Comment