=> Click Here For The QTP Training Tutorials Series
What is Test Automation Framework and what’s QTP Framework?
Recommended IPTV Service Providers
- IPTVGREAT – Rating 4.8/5 ( 600+ Reviews )
- IPTVRESALE – Rating 5/5 ( 200+ Reviews )
- IPTVGANG – Rating 4.7/5 ( 1200+ Reviews )
- IPTVUNLOCK – Rating 5/5 ( 65 Reviews )
- IPTVFOLLOW -Rating 5/5 ( 48 Reviews )
- IPTVTOPS – Rating 5/5 ( 43 Reviews )
In the context of a profitable implementation of QTP for a software program testing challenge we frequently come throughout the idea of frameworks. The framework is nothing however an strategy that we persistently comply with through the automation course of – a set of tips.
What You Will Learn:
Test Automation Frameworks
Personally, I don’t like to offer names and say that one works higher than the opposite. The number of a sure framework will not be the start of a challenge. It is the reverse that’s true. In the method of devising a testing technique, you construct the foundations which can be relevant to the tester’s present scenario, and that proper there’s your framework.
Having mentioned that, the next are a number of the necessary factors we have to contemplate:
- Reusability
- Script’s simple upkeep
- Readability of scripts
- Good workable folder construction for all of the take a look at belongings.
- No arduous coding values
- No cascade of failures (i.e. if one take a look at fails, it shouldn’t trigger failure or stopping of others).
This is a fundamental record and extra could be added based mostly on the requirement.
Any testing technique that tries to include some or all the above factors is a part of your Test Automation Framework.
There are numerous names and varieties of frameworks. Given under is the record of frameworks based on me.
Types of Automation Frameworks (Applies for QTP Framework)
- Linear: The easiest type of making a take a look at. Just write one single program with out modularity in sequential steps
- Keyword-driven: Create completely different key phrases for a unique set of operations and in the primary script we will simply refer to those key phrases.
- Data-driven: To run the identical set of operations on a number of units of knowledge which can be saved in separate information, largely excel sheets.
- Hybrid: A mix framework that may be partly data-driven and partly keyword-driven.
- BPT: This simply signifies that packages are damaged down into enterprise elements and are used with one or the opposite of the above varieties of frameworks
Linear Framework
As mentioned, this strategy includes merely writing the code as we document and protecting it going.
For instance, if the operation that you must confirm is the creation of a brand new account in Gmail, then the next would be the steps:
- Open gmail.com
- Click on “Create Account”
- Enter the main points
- Verify the main points
- Create an account
'Open GMail SystemUtil.Run “iexplore.exe”, “http://www.gmail.com” 'Page Sync Browser(“Gmail”).Page(“Gmail”).Sync ‘Click on create account Browser(“Gmail”).Page(“Gmail”).WebLink(“Create Account”).Click ‘Enter the main points Browser(“Gmail”).Page(“Google Accounts”).WebEdit(“First Name”).Set “Swati” Browser(“Gmail”).Page(“Google Accounts”).WebEdit(“Last Name”).Set “take a look at” ‘Fill in a number of different particulars ‘Submit Browser(“Gmail”).Page(“Google Accounts”).WebButton(“Next Step”).click on
Given above is an instance of what a program that makes use of the linear methodology seems like. It is clear at this level as what the benefits and disadvantages of this methodology are.
Advantages:
- Simplicity: For newbie programmers, this methodology is apt.
- Time: It doesn’t take a whole lot of time to create the take a look at.
- Very little planning is required
Disadvantages:
- No reusability in any respect.
- If there’s one other script that verifies a sure side of the ‘Google Accounts’ Page then you’ll have to rewrite the code to launch the gmail.com web page too. Hence, numerous repetition.
- All the info is straight embedded into the code. Hardcoding doesn’t enable the code for use for another set of knowledge.
- Error-prone and upkeep is tough
While the cons outweigh the professionals, this methodology can be utilized when your goal is strict to perform a job with out validations.
The elements of take a look at belongings in this sort of framework are:
- Test script
- Object repository (This could be prevented by utilizing descriptive programming if wanted)
Keyword-Driven Framework
How can we make the above linear framework take a look at higher? How can we overcome these cons?
Obviously, we want reusability, modularity, and readability. Trying to include these options and arriving at an optimum answer is nothing however an try at creating a brand new, extra improved framework.
What are the Reusable elements?
- Launching of Gmail and arriving on the ‘Google Accounts’ web page. This is given as validating this web page means to first get right here. ‘GoTo Google Account” – could be made right into a separate operate that may be known as over and over once more.
- Enter the main points and validate them – You can additional break this up into constructive and adverse blocks to incorporate extra ranges of modularity.
- Account creation – Final degree of validation and undertaking the duty at hand.
Once you will have arrived right here, you haven’t solely recognized elements that may be known as over and over once more, however you will have additionally damaged your linear program into modules.
Functions:
So far in our sequence, we’ve got not handled features. Functions are nothing however a bit of code that does sure operations. It accepts enter parameters from this system that calls it and returns worth to it.
As a common follow, all of the reusable items of code are grouped right into a file that comprises all of the reusable features. This file is related to a useful resource to your QTP take a look at. Typically a operate library could be a file of kind: .vbs, .txt or .qfl
Back to our instance – This is how the operate library file could be:
Function gotoGoogleAccount() 'Open Gmail SystemUtil.Run “iexplore.exe”, “http://www.gmail.com” 'Page Sync Browser(“Gmail”).Page(“Gmail”).Sync ‘Click on create account Browser(“Gmail”).Page(“Gmail”).WebLink(“Create Account”).Click ‘Enter the main points End Function Function EnterParticulars() Browser(“Gmail”).Page(“Google Accounts”).WebEdit(“First Name”).Set “Swati” Browser(“Gmail”).Page(“Google Accounts”).WebEdit(“Last Name”).Set “take a look at” ‘Fill in a number of different particulars End Function Function SubmitToCreate() ‘Submit Browser(“Gmail”.Page(“Google Accounts”).WebButton(“Next Step”).click on End Function
Your Actual script will probably be:
'Open GMail gotoGoogleAccount() ‘Enter the main points EnterParticulars() ‘Submit SubmitToCreate()
From the above program, it’s now clear that we’ve got achieved readability, modularity and if in case one other program needs to make use of the login operate, we will certainly reuse it. All you must do is affiliate the operate library with that new take a look at too and you’re good to go.
You may also see that in your script the operate names are functioning as if they’re VBScript’s key phrases and the identify for this framework.
The elements of take a look at belongings in this sort of framework are:
- Test scripts
- Shared OR
- Shared operate library
Now, what else would make this program even higher? If we might make the EnterParticulars() operate to take completely different units of knowledge and create completely different accounts and not be restricted to the info that we hard-coded into this system. That is precisely the following step. Data driving your checks and the strategy the place we do this can be a data-driven framework.
We will talk about Data-driven and Hybrid frameworks intimately within the upcoming tutorial.
=> Visit Here For The QTP Training Tutorials Series
If you will have any QTP framework-related points that aren’t coated in these articles, do tell us and we’ll most undoubtedly attempt to reply your questions.