This is the most basic
framework where you write your script as is. That is, with this
approach you write all the steps one after the other in a linear
fashion.
QTP Linear Framework approach
Linear Framework is nothing but writing all the steps in your action one after the other in a linear form. This approach is also called linear scripting. In this approach, your entire test case flow will be written in QTP in a linear fashion.
Consider an example where you have a test case to login to application, search for some data and then logout. In linear framework, the code would look like something shown below.
Code to Open Application
Code to enter user name in Login Page
Code to enter password
Click on Login button and verify successful Login
Search for the required data
Logout from the application
Close the application
As you can see in the above example, you are not doing much in terms of framework creation with this type of QTP Framework. Hence this is the simplest framework to use and implement.
QTP Linear Framework – Advantages and Disadvantages
Advantages
1) Very little automation expertise required. Only the tool knowledge is necessary for creating scripts.
2) This is the fastest way to create scripts.
3) Since the framework is not complex, it becomes very easy to understand the flow.
Disadvantages
1) Since the code is written in linear manner without the use of any functions, there is very little scope of re-use.
2) The only way to re-use the code is to copy paste it wherever needed. Hence you will have the same code being written at multiple place. Maintaining this code is very time consuming and error prone because you have to make changes at all the affected places.
3) In this framework, test data is hard-coded in the script. So you cannot use the same code to test multiple sets of data. Either you have to change the data after every run or you have to create multiple copies of the code to test different data. Both these methods are inefficient.
Follow @TestingQ
QTP Linear Framework approach
Linear Framework is nothing but writing all the steps in your action one after the other in a linear form. This approach is also called linear scripting. In this approach, your entire test case flow will be written in QTP in a linear fashion.
Consider an example where you have a test case to login to application, search for some data and then logout. In linear framework, the code would look like something shown below.
Code to Open Application
Code to enter user name in Login Page
Code to enter password
Click on Login button and verify successful Login
Search for the required data
Logout from the application
Close the application
As you can see in the above example, you are not doing much in terms of framework creation with this type of QTP Framework. Hence this is the simplest framework to use and implement.
QTP Linear Framework – Advantages and Disadvantages
Advantages
1) Very little automation expertise required. Only the tool knowledge is necessary for creating scripts.
2) This is the fastest way to create scripts.
3) Since the framework is not complex, it becomes very easy to understand the flow.
Disadvantages
1) Since the code is written in linear manner without the use of any functions, there is very little scope of re-use.
2) The only way to re-use the code is to copy paste it wherever needed. Hence you will have the same code being written at multiple place. Maintaining this code is very time consuming and error prone because you have to make changes at all the affected places.
3) In this framework, test data is hard-coded in the script. So you cannot use the same code to test multiple sets of data. Either you have to change the data after every run or you have to create multiple copies of the code to test different data. Both these methods are inefficient.