Benefits of Keyword-Driven Testing

A keyword driven framework is a type of functional test automation framework that separates test cases from test code. Like the name suggests, a keyword-driven test contains a keyword that defines the action to be performed by a test. Each keyword corresponds to an individual testing action such as a mouse click, selection of a menu item, or opening a window.

To perform any testing actions, testers can drag and drop the keyword that corresponds to the desired operation. Or they can record their actions and the keyword-driven test is built for them.

How to Create Keyword-Driven Tests

The easiest way to create keyword-driven tests is to record them using a record-and replay tool. This technique doesn’t require you to know the application’s internal objects, only to know what you plan to test.

After recording, you can modify the keyword-driven test and customize it to fit your needs. Keywords are organized into tables representing a test to be executed. You can add and delete operations and edit them by changing the parameters and position.

Keyword-Driven Tests vs. Test Scripts

To write a test script, knowledge of a scripting language, such as Python, Javascript, or VBScript, is needed. To implement these test scripts, your automated testing tool needs to support your language of choice.

On the other hand, keyword-driven scripts don’t require knowledge of a scripting language. This process of test creation and execution can be easier and faster for non-technical testers. If your test automation tool only provides scripting, it makes the learning process more difficult and can negatively impact the success of your testing efforts.

Create Automated Tests Earlier in Development

Fixing bugs early in development is easier than fixing them late in development, or even in production. For this reason, it’s good practice to start test automation at the beginning of the application’s design instead of waiting for the application to be completed. This also means when new features are introduced, it’s best to create automated tests for them as early as possible.

With keyword-driven testing, you can create simple, functional tests early in the development process. That way, you’re improving test coverage while also eliminating testing bottlenecks in the release cycle.

Create Automated Test Batches Using Logic

Keyword-driven tests allow you to introduce logic into the organization of your automated tests. By building some simple decision-making logic into a keyword-driven test, you can control how your tests are run.

For example, say you have three different tests: Test A, Test B and Test C. Test B is dependent on Test A and Test C is dependent on Test B. With this simple decision-making logic in your tests, you can run them in batches and tailor your workflow. That way if Test A fails, Tests B and C won’t run.

Benefits of Keyword-Driven Testing with TestComplete

TestComplete is an automated functional UI testing tool for desktop, web, mobile, and packaged applications. With this tool, you can create different types of automated tests such as data-driven, regression, and many more.

Whether you’re a technical or non-technical tester, TestComplete has capabilities to support you. It supports scripting in languages like Python and JavaScript, as well as keyword-driven testing with the ability to record-and-replay tests.

The tool also provides several keyword-driven test operations. You can perform various test actions such as calling object methods, checking object states, and searching for an object. It also keeps track of your most frequently used keyword-driven test operations and gives you quick access to them.

In addition to this, TestComplete has special keyword-test operations and a wizard for data-driven test creation. Using these operations, you can configure your test to automatically retrieve data from a database, Excel sheet, or CSV file. Then, you can use the data to simulate user actions on the tested application's windows and dialogs.

The Bottom Line

Keyword-driven tests are a great place to start for non-technical users and can be as simple or as powerful as needed. And when incorporated into your testing strategy, you can save significant amounts of time and make strides in overall application quality.

Want to try key-word driven testing with TestComplete? Click here to start a free trial today.