Introduction

The concept of keyword-driven testing allows business analysts and testers to describe test cases without any deep QF-Test knowledge. Those test cases can either be described in a meta-language or directly in a testmanagement system. QF-Test will then read and execute those test cases. The implementation of the underlying test steps inside QF-Test needs to be done by engineers having QF-Test knowledge.

Business testers and QF-Test engineers are free in defining the way how to describe test steps. They can define a wide range of keywords like simple action-related keywords (e.g. click a button) or more complex business-related keywords (e.g. create an object inside the SUT). Combining test steps into a test case could be achieved by a strict table-oriented approach like clickButton=OK or formulating the test steps in continuous text like "Close the dialog via click on ok".

The following examples illustrate the most popular variants of defining test cases in a keyword-driven manner. The demo test case will create a vehicle in the CarConfigurator demo application of QF-Test.

Option 1: Business-related test steps (see subsection 29.2.1). You find a sample at qftest-7.1.0/demo/keywords/simple_business.

Test step
Launch SUT, if necessary
Open vehicles dialog via Options -> Vehicles
Enter data (name and price)
Press new in order to create the vehicle
Press OK in order to close the dialog
Check creation of vehicle in table
Table 29.1:  Test case using business-related keywords

Option 2: Atomic test steps (see subsection 29.2.2). You find a sample at qftest-7.1.0/demo/keywords/simple_atomic.

Test step
Launch SUT, if necessary
Select menu 'Options'
Select menu 'Vehicles...'
Fill text-field 'Name'
Fill text-field 'Price'
Press button 'New' in order to create the vehicle
Press button 'OK' in order to close the dialog
Check table, whether new created vehicle appears
Table 29.2:  Test case using atomic keywords

Option 3: Behavior-Driven Testing (BDT) from a technical perspective (see subsection 29.4.1). You find a sample at qftest-7.1.0/demo/keywords/behaviordriven.

Test step
Given SUT is running
Given vehicles dialog is opened
When vehicle name is set to <name>
And vehicle price is set to <price>
And button new clicked
And button ok clicked
Then row with <name> and <formatted-price> appears in table
And column model has value <name>
And column price has value <formatted-price>
Table 29.3:  Test case with Behavior-Driven Testing from a technical perspective

Option 4: Behavior-Driven Testing (BDT) with business keywords (see subsection 29.4.2). You find a sample at qftest-7.1.0/demo/keywords/behaviordriven_business.

Test step
Given application is ready to enter vehicle data
When vehicle created with <model> and <price>
Then <model> with <formatted price> appears in table
Table 29.4:  Test case with Behavior-Driven Testing from a business perspective

In the subsequent sections you will find a more detailed description of those variants of keyword-driven testing with QF-Test. The concept of Behavior-driven testing (BDT) is described in section 29.4. From a perspective of QF-Test BDT is just a special variation of keyword-driven testing.

All samples use the CarConfigurator of QF-Test which is also provided by the installation. You can find all samples in the folder qftest-7.1.0/demo/keywords/. In order to show the test planning aspects we provide Excel files containing the required test steps. Of course you can also go ahead and use your testmanagement tool to plan test steps. We are using Excel files as Excel is a very common piece of software and reading Excel file is quite simple in QF-Test.

The section keywords with dynamic components (see section 29.3) describes how to use QF-Test just as test-executor without really recording steps within QF-Test. You need to interact with QF-Test only in rare cases when applying this scenario.

Please take care to copy all test suites to a project-related folder first and modify them there.