I am very new in QTP and I am gonig to start with QTP from the next week in my company.... It will be very convenient for me if I get the answer on the following Question ASAP....
1. Say I have 50 Test Cases for Login Page, How I will manage it in QTP? I mean shall I have to write 50 Functions in a single Test....,OR I have to make 50 different Tests....How this type of conditions managed in Real Life projects....
Before Automating Any Scenario ,Automater need to analyze the test cases.Analyzing the scenario will help to understand the fact that how many scripts,functions are required.
Hi All ,
The above best practise could be explained as :
1)Reusablity of Code : To find the extent of reusability ,you should know the manual functionality throughly and the filter out the common functional flow .Create reusable actions --> use call to copy of the action wherever those are repeatable and modify them accordingly .
2)Less Maintanance : Descriptive programme is a good option for this.Try to fetch the dynamic values through Datatables.
3)Easy to Understand: Follow proper identation together with naming conventions e.g : string variable with str ,integers with int so on
05-13-2012, 01:30 PM (This post was last modified: 05-13-2012, 05:18 PM by Anish10110.)
Mostly, the approach should be Functional + Data Driven ie Hybrid Framework. But deciding how the framework should be designed depends on the application and the flows you have.
The first thing. Analyze all the test cases and then come up with what all business flows you have. Try to see if there are any reusable flows.
For example: suppose you have 3 test cases.
1) Login and create order and logout.
2) Login and search order and modify order and logout.
3) Login and search order and delete order and logout.
So here you can identify that Login, Logout and Search Order are reusable flows.
Once this is done. You can try creating the framework. Your entire framework, data sheet structure etc will be based on this only.
As of now you can start with 1 TC for each of the 20 workflows(I'm assuming that these workflows are test cases with multiple smaller flows.
Steps to write framework:
1) Write the full flow in the test case. Hard-code all data values as of now.
2) If there are any reusable flows in the test case, create functions for those and save it in function library and call from there.
3) Now write the code which will take the data from data sheets.
4) For the sake of simplicity, you can have 1 excel workbook with 20 sheets. Each sheet for each test case.
5) This way create the first test case as per the framework.
6) Add all the error handling mechanism and all other required things to the same test case.
7) Now you will have 1 TC which is written as per your framework.
8) Once 1 TC is finished, you can follow the above process only to create other test cases as per the framework.
You can also check the attached eBook on QTP Framework Basics.
Note: Please make sure you contribute to the forum on regular basis before posting links to 3rd party sites. For new members, this forum software will automatically mark all posts as spam which contain link to other sites.