Selenium WebDriver, Keyword Driven Framework Design Architecture ,XLSX,Reflection API



In this tutorial we are going to discuss about the implementation of Keyword Driven Framework. In Keyword Driven framework, you can create various keywords and associate function with each of these keywords. Then you create a Function Library that contains the logic to read the keywords and call the associated action.
Advantages:
The keyword and function libraries are completely generic and thus can be reused easily for different applications
All the complexity is added in the function libraries. Once the libraries are ready, it becomes very easy to write the actual test script steps in excel sheets.
Disadvantages:
Lot of time and effort needs to be spent initially to create the function libraries.
The benefits of the keyword driven framework are realized only after it has been used for longer periods of time.
Lets get into the implementation of the framework.
This framework is mainly implemented using the Reflection API where the method name is invoked based on the keyword passed in the XLSX file.
Pre-Requisites
Dependencies:

  • Selenium WebDriver
  • TestNG
  • Apache POI

KeywordDrivenFramework

KeywordDrivenFramework




Logic :DriverScript.java

Logic :ActionClass.java

Logic :ExcelUtils.java

Logic : testng.xml

Logic :inputData.xlsx
Github Link for xlsx file:
https://github.com/totalqa9/KeywordDrivenFwk.git

Conclusion:
Using the Logic mentioned above helps to implement the Keyword Driven Framework successfully in your projects.
Let us know if you have any queries in implementing this framework.
Drop an email to totalqa9@gmail.com

Leave a Reply

Your email address will not be published. Required fields are marked *