Keyword Driven Framework refer to an application-independent automation framework, where for a particular test case, we would create an set of keywords and then associate an action (or function) which each of these keyword.These keywords run independent of the test automation tool used to execute them and the test script code that “drives” the application-under-test and the data.
Working Copy of the Keyword Driven Framework
Keyword-driven tests look very similar to manual test cases. In a keyword-driven test, the functionality of the application-under-test is documented in a table, as well as in step-by-step instructions for each test.
It can be implemented in two ways:-
1.Keywords are associated with entire functions
(Refer the below example, here ‘COMMENT,LAUNCH,VERIFYRESULT‘ refers the complete operation)
2.Keywords are associated with the lowest level operation on an object
(‘Click‘ keyword in the below example)
Lets say we want to automate “Windows Calculator” and following is our test case:-
1.Go to Run and Type Calc
2.Do addition operation on 2 buttons
3.Check the Result
Now lets design a Keyword driven sheet for the above test case:-
|Keyword Driven Test Sheet|
Test Details:-Steps to be performed.
MainWindow :- Application window
Keyword:- This column lists the action taken with the mouse (or by the tester).Here we have two types of Keyword, Function (COMMENT,LAUNCH,VERIFYRESULT) and Step-by-Step(like Click)
Object:- Main object on which action is taken in our case it is only Button
Value:-This Arguments column represent the value that we have passed to the object while performing the operations (1, 2, 3, 5, +, -, and so on).
We can define Keyword more specifically, as follows
What is Keyword?
Keyword:-Any word as the key to a code or a reserved word to identify a specific command. Keywords trigger specific functions in the framework to perform a specific operation on the desired object in the application.
Examples of Keywords:-
- Test Objects ->Winedit,Weblist,Dialog
- Functions -> COMMENT,LAUCH,REUSLT,BULITIN
- Methods ->Set, Click
- Statement ->Dim, If Endif
- Operator -> *,+