Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Explain Keyword driven framework.
Keyword driven framework is also known as table driven framework. Here we have a table where we describe the keywords or actions for the methods that have to be executed.
Automation test scripts are developed based on the keywords or actions mentioned in excel. The automation testers need to extend the framework capabilities by updating or building newer keywords.
Framework Structure
People working on manual testing with lesser programming knowledge can use this framework. The main idea is to identify the keywords or actions and utilize them in excel maintained for that particular test scenario. Often this excel sheet becomes a substitute for a test case document.
Technical Implementation
However, the building or development of this framework with the keywords requires strong technical knowhow. One important aspect of this framework is that each of the keywords has a specific action to be performed on an object. An action is basically the functional requirement of the product.
The objects refer to the elements or the other resources like URL or database credentials for the environment on which execution is to be performed. However once the framework includes more and more keywords and features, it no longer remains scalable.
Example Implementation
// Keyword mapping in JavaScript
const keywordActions = {
'OpenBrowser': function(object, testData) {
// Launch browser with specified URL
driver.get(testData);
},
'EnterText': function(object, testData) {
// Enter text in specified element
driver.findElement(By.id(object)).sendKeys(testData);
},
'ClickButton': function(object, testData) {
// Click on specified button
driver.findElement(By.id(object)).click();
},
'VerifyText': function(object, testData) {
// Verify text on page
const actualText = driver.findElement(By.id(object)).getText();
assert.equal(actualText, testData);
}
};
// Execute test based on keywords
function executeTest(testSteps) {
testSteps.forEach(step => {
const action = keywordActions[step.keyword];
if (action) {
action(step.object, step.testData);
}
});
}
Best Practices
While using this framework, the user should be aware of all the developed keywords and their purposes in order to use it in the best possible way.
Advantages
Both automation and manual testers can work and contribute to this framework.
A keyword or action can be used in several test cases.
Test data and test logic are separated, making maintenance easier.
Non-technical team members can create test cases using predefined keywords.
Limitations
Initial setup requires significant technical expertise and time investment.
Framework becomes less scalable as the number of keywords grows.
Debugging can be complex when keywords interact unexpectedly.
Conclusion
Keyword driven framework provides an excellent balance between technical automation and manual testing accessibility. It enables teams with mixed technical skills to collaborate effectively on test automation while maintaining reusable and maintainable test assets.
