Or
Keyword-driven testing is an application-independent framework utilizing data tables and self-explanatory “keywords” to explain the actions to be performed on the AUT.
Keyword-driven testing splits the test procedure into logical components. These logical components are then used repeatedly in the assembly of new test scripts.
Below I have given 3 examples of Keyword Driven Automation Framework. These may not be complete in them, but are a sort of starter in order to give you a little feel so that you can start well on your own.
Example 1
WINDOW | COMPONENT | ACTION | EXPECTED VALUE |
---|---|---|---|
Yahoo Sign-in Page | Yahoo!ID box | VerifyValue | "UserName" |
Framework Pseudo-Code |
---|
Primary Record Processor Module:
Textbox Component Module:
Textbox.VerifyValue Function:
|
Example 2
Code: | |
---|---|
Launch | Yahoo! Mail |
Verify | Yahoo! Mail Login Screen |
Login | Username Password |
Verify | Welcome Screen |
Logout |
Here, the keywords are Launch, Verify, Login, and Logout, but they could be any actions relevant to your testing context.
Example 3
Test | 1 | |
---|---|---|
Login | John | AAA |
VerifyScreen | WelcomeScreen | |
Logoff | ||
Test | 2 | |
Login | Sara | BBB |
VerifyError | “Wrong username.” | |
Test | 3 | |
Login | Tammy | CCC |
VerifyError | “Unknown Error.” |
Above, the first column commands are called keywords or action words.
Test driver reads the test file, searches for the library function associated with the keyword (Login) and then performs execution using remaining data on the row (“John,” “AAA”) as arguments to the function.
Advantages:
Spreadsheet can be used to write detailed test plan including all input and verification data.
"Generic" utility scripts created for testing an application can be reused to test another application.
Higher levels of maintainability and efficiency can be attained by using the same principles of functional decomposition (modularity) with Keyword driven framework and separation of script and data (data driving).
Another advantage of the keyword driven approach is that testers can develop tests without a functioning application as long as preliminary requirements or designs can be determined.
Disadvantages:
Scripting language proficiency is needed.
It may require longer implementation time.
Also See:
5 Generations of Test Automation
Functional Decomposition Framework
Choose Your Test Automation Framework