Test Automation Framework

about Test Automation frameworks. Here I would like to Collete the useful inputs i received from various QTP groups and discussion forums.

what is qtp automation frame work,what is the use of that frame work?

Automation frame work is nothing but a set of guidelines designed by expert to accomplish a task in an effective,efficient and an optimized way.
In QTP-The frameworks which includes :
1) Object Driven
2) Keyword driven
3) function driven
4) Data table driven
5) Hybrid driven(Mixture of above all)
Basically, there is 4 types
1) Linear
2) Modular
3) Keyword
4) Hybrid

QTP framework is a set of good practices to support test automation.The folder structure is frame work folder->folder with the name of application->sub folders are
1.data
2.library
a.generic script
b.configuration
3.main script
a.project specific script
4.object repository
repository.tsr
5.log
6.results
7.environment.xml
8.module driver.vbs

Types of Frame Works are:
1) Linear framework :
this is normal process like recording or scripting the program and executing it. This is not reusable, once executing these script.

2) Key Word Driven Testing:
The Keyword Driven framework consists of the basic components given below
1. Control File
2. Test Case File
3. Start up Script
4. Driver Script
5. Utility Script

1. Control File :
a) Consists details of all the Test scenarios to be automated
b) User will be able to select a specific scenario to execute based on turning on or off a flag in the Control File
c) Control File is in the form of an excel worksheet and contains columns for Scenario ID,Execute (Y/N),Object Repository Path, Test Case File Path

2. Test Case File :
a) Contains the detailed steps to be carried out for the execution of a test case
b) It is also in the form of an excel sheet and contains columns for Keyword, Object Name, Parameter

3. Start up Script :
a) The Start up script is utilized for the initialization and reads the control files
b) It then calls the driver script to execute all the scenarios marked for execution in the control file

4. Driver Script :
a) It Reads the Test Case files. Checks the keywords and calls the appropriate utility script functions based on specific keyword
b) Error Handling is taken care of in the driver script.

5. Utility Scripts :
a) Perform generic tasks that can be used across applications. It should not be application dependent Advantage of Framework.
Note:
1.The main advantage of this framework is the low cost for maintenance. If there is change to any test case then only the Test Case File needs to be updated and the Driver Script and Start up script will remain the same.
2.No need to update the scripts in case of changes to the application.
also Keyword-driven testing is a Software testing technique that separates much of the programming work from the actual test steps so that the test steps can be developed earlier and can often be maintained with only minor updates, even when the application or testing needs change significantly.

Here repository folder is used for save the objects of the application. First read all the objects by using object repository and then export all the objects to repository folder by giving .tsr extension (test shared repository). library file folder is used for save functions, which is created by the user. Suppose take one login window and create a function, first open notepad and create function as per your required.
public function login( )
dialog (“login”).activate
dialog (“login”).winedit (“agent name”).set”baba”
dialog (“login”).winedit (“password”).set secure”xxxxxxxx”
dialog (“login”).winbutton(“ok”).click
end function ( )
then save with .vbs extension in to the library file folder.after that associate this function to qtp library files. The navigation is test setting----->resources then click + tab and browse the function. In this manner create no of functions as per required and associate all the functions to qtp.suppose some example
insert order ( ), logout ( ), update order( ).
recovery file folder is used for save recovery scenarios which is created by the user. Create recovery scenarios and save those recovery scenarios with .qrs extension with recovery file folder. After that associate those recovery scenarios to qtp.navigation is test setting---recovery then click +tab and browse the file.Test data folder is used for save input data. Suppose through flat file method, open the notepad and give input data and save with .txt extension in test data folder.

3) Data-driven Testing:
Data-driven testing is a framework where test input and output values are read from data files (data pools, ODBC sources, csv files, Excel files, DAO objects, ADO objects, and such) and are loaded into variables in captured or manually coded scripts. In this framework, variables are used for both input values and output verification values. Navigation through the program, reading of the data files, and logging of test status and information are all coded in the test script.

Data-driven testing (DDT) is a term used in the testing of computer software to describe testing done using a table of conditions directly as test inputs and verifiable outputs as well as the process where test environment settings and control are not hard-coded. In the simplest form the tester supplies the inputs from a row in the table and expects the outputs which occur in the same row. The table typically contains values which correspond to boundary or partition input spaces. In the control methodology, test configuration is "read" from a database.

4) Modularity-driven testing
The test script modularity framework requires the creation of small, independent scripts that represent modules, sections, and functions of the application-under-test. These small scripts are then used in a hierarchical fashion to construct larger tests, realizing a particular test case.Of all the frameworks, this one should be the simplest to grasp and master. It is a well-known programming strategy to build an abstraction layer in front of a component to hide the component from the rest of the application. This insulates the application from modifications in the component and provides modularity in the application design. The test script modularity framework applies this principle of abstraction or encapsulation in order to improve the maintainability and scalability of automated test suites.

This is different from liner frame work, here recording or scripting the program and those script split into actions and make those actions as reusable actions. These reusable actions can use any where in the test.

No comments:

Post a Comment