A Sample Keyword Framework
A Framework defines a set of guidelines that enforces a set of standards which makes it easy to use for the end users to work with. A set of guidelines like coding standards, test-data handling, object repository.
Following is the example of Keyword driven framework approach
Installation Instructions
“Automation” folder in “C” drive.
- Linear – Simplest form of creating a test. Just write a one single program without modularity in sequential steps
- Keyword driven – Create different keywords for different set of operations and in the main script we can just refer to these keywords.
- Data driven – To run same set of operations on multiple sets of data that are kept in separate files, mostly excel sheets.
- Hybrid – A combination framework that can be partly data driven and partly keyword driven
- BPT – This just means that programs are broken down into business components and are used with one or the other of the above types of frameworks
Following is the example of Keyword driven framework approach
Installation Instructions
“Automation” folder in “C” drive.
Folder Structure and Purpose
- ErrorLog: If any of the script failed then QTP will capture the screen shot and stores it in ErrorLog folder
- Library: will contain all reusable function file, Keyword driver file, Html report generation file and Object repository (in excel)
- Results: will contain all test results in HTML format
- TestScript: will contain all the scripts(in Excel format) related to AUT. Also contains Controller script (QTP script)
- InputData : will contain all Login credentials, URL’s and Dynamic data
Environment setup
- Navigate to Automation Folder and openController scripts from QTP
- Open Controller.xls (C:\Automation\TestScrips\Controller.xls) and make it YES or NO depending on which scenario/script has to run
- Open InputData.xls (C:\Automation\InputData.xls) and open URL sheet and specify the URL path
- Execute the scripts
- Look for the results in Result folder (C:\Automation\Results\)
- There are 2 types of reports i)Summary Report (ii)Detail Report
Controller file to execute the scripts in batch by making Yes or No
Scripts will be in the form of keywords in the excel, no QTP or VB coding. Just calling methods from excel
Sample scripts, calling keyword methods
Input data sheet