A Keyword Driven Framework is one in which test actions are associated with keywords stored in external files (usually Excel or CSV). The actual implementation code for each keyword is in the framework itself.
Core idea:
- ✓Each action (click, type, navigate, verify) is represented as a keyword
- ✓Test cases are written as sequences of keywords + parameters in a spreadsheet
- ✓The framework reads each keyword and executes the corresponding method
Example keyword mapping:
| Keyword | Action |
|---|---|
launchBrowser | Opens the browser |
navigateTo | Navigates to a URL |
writeInTextBox(webElement, textToWrite) | Types text into a field |
clickButton(webElement) | Clicks a button |
verifyText(webElement, expectedText) | Asserts element text |
External test case file (Excel):
CODE
TestStep | Keyword | Object | Value
1 | launchBrowser | chrome |
2 | navigateTo | | https://automateqa.online
3 | writeInTextBox | usernameField | admin
4 | writeInTextBox | passwordField | pass123
5 | clickButton | loginBtn |
6 | verifyText | welcomeMsg | Welcome, Admin
Benefits:
- ✓Non-technical team members can write test cases using keywords
- ✓Code changes are isolated in the framework — test sheets stay unchanged
- ✓Highly reusable keyword library
