Key Word Driven Framework
Framework where for a particular test case, you would first identify a set of Keywords and then associate a method (or function) to each of these keywords.
Consider for example login flow of Face book is the case to be automated
Steps 1 . Login to Face Book
Steps 2 . Check any notifications
Steps 3 . Logout
Now we have got the steps ( taking pure modular approach we can divide the steps into modules or functions )
So there are 3 methods / functions
Test cases
Framework where for a particular test case, you would first identify a set of Keywords and then associate a method (or function) to each of these keywords.
Consider for example login flow of Face book is the case to be automated
Steps 1 . Login to Face Book
Steps 2 . Check any notifications
Steps 3 . Logout
Now we have got the steps ( taking pure modular approach we can divide the steps into modules or functions )
So there are 3 methods / functions
Test cases
- Login to Facebook
- Check the notifications
- Logout from Face book
Once Test cases are identified
Identify the Keywords ( Keywords can be any name which is easier to remember or understand)
- FBLogin
- FBNotificationCheck
- FBLogout
Once keywords are identified next step is to associate the Keywords to Methods
Now according to the above case we need to do 3 steps
1. Create a keyword and save it somewhere
2. Develop a module
3. Associate the keyword and the respective modules
Part of the work is done , now the flow comes to picture
Below is the list of common components or questions appears in most of the keyword driven frameworks.
1. Where to save the Keywords and Modules
Once the Keywords are identified we can use Excel sheet to save the Keywords, but write a
Method(Main() ) to open the excel sheet and get the keywords
2. Where to save the Modules ?
In Keyword Driven framework methods play a very important role , so You would have to built all the necessary intelligence in the java methods so that it can read the excel sheets and call the different Modules/Methods based on the Keywords.
Better we save the methods in a separate folder naming Business flow ( as per individuals interest or project requirements)
Build all your business flow or function intelligence here and save as separate files or single , depends on the developer and requirements
3. Data sheet needed ?
It depends – To save the data we need to for the Test case to be used by the application
4. Test Scripts ( As per project requirement)
You can have separate test scripts for each manual test case or a single driver script that will execute all the test cases
below flow indicates the full flow
From the above figure, you can see that the generic flow of a Keyword Driven Framework is something like this -
1) MAIN Method calls the other Methods which has code to read the excel sheet
2) The Methods called from the Main method opens the excel sheet and reads the first keyword associated with the test case.
3) Once the keyword is read from the excel sheet , It searches for the associated Methods ,Once the associated methods are identified then the method is excuted on the application that is being tested.
4) Control returns back to main function (in Step 2) which then reads the next keyword. Steps 2 to 4 are repeated till all the keywords associated with a particular test case are called.
Now how to associate the keywords is important ( it depends on project )
Broadly dividing it into 2 ways
1 . Associate the keywords to a whole function or method
2 . Associate the keywords to a object level operations like
associating one key word for entering username , one for entering password , one for clicking button and so on
To Explain the above two implementation let us consider 3 test cases
TC_01= Login to Facebook , check for notification's , logout
TC_02 = Login to Facebook , check for friends request , logout
TC_03 = Login to Facebook , check for birthday notifications , logout
Associate the keywords to a whole function or method
This is the most general format that is used in many of the places
In the above diagram we can see how the associations are done
Now when the Main method is called it opens the excel sheet , reads the first line .
Associate the keywords to a object level operation
This is another method of implementation
In the above diagram we can see how the associations are done on operations level ( its self explanatory)
Now when the Main method is called it opens the excel sheet , reads the first line .
Any doubts or any extra information to be added , Please Post a comment
If we search in the net for Key word Driven Framework . We can find wide variety of answers .
It depends on the requirements
Broadly dividing it into 2 ways
1 . Associate the keywords to a whole function or method
2 . Associate the keywords to a object level operations like
associating one key word for entering username , one for entering password , one for clicking button and so on
To Explain the above two implementation let us consider 3 test cases
TC_01= Login to Facebook , check for notification's , logout
TC_02 = Login to Facebook , check for friends request , logout
TC_03 = Login to Facebook , check for birthday notifications , logout
Associate the keywords to a whole function or method
This is the most general format that is used in many of the places
In the above diagram we can see how the associations are done
Now when the Main method is called it opens the excel sheet , reads the first line .
- It captures the Test case name TC_01 , once the Test case name is captured
- It capture the first Keyword i.e FBLogin in this case, once the keyword is got , it checks for the associated method and execute it against the AUT
- Step 2 is repeated until all the keywords are done for First case ( TC_01)
- Once the TC_01 is done it jumps to next Test case(TC_02) and repeat the 2 step for its corresponding keywords
Associate the keywords to a object level operation
This is another method of implementation
In the above diagram we can see how the associations are done on operations level ( its self explanatory)
Now when the Main method is called it opens the excel sheet , reads the first line .
- It captures the BrowserType , Title , now the element is captured .
- Once the element is captured it checks the properties
- Once the properties are captured it checks for the operations to be performed
- Here the values are associated to it
Any doubts or any extra information to be added , Please Post a comment




No comments:
Post a Comment