Start your demo and save on the first 12 months!

Blog

Keywords-driven test automation.

Posted by on 17 September 2020 in Blog

What is keyword-driven testing?

Keyword-driven testing is a software testing methodology based on “keywords”.
A keyword consists of one or more words and is used as a reference term for the execution of a defined testing task.
A keyword describes an individual simple action, like “Click” for a mouse click or “Type” for a keystroke, or a set of actions that are required to perform a more complex testing task, like “Log On” to login to an account.
A keyword-driven test consists of a list of keywords in a tabular format, including the argument (the data) of these keywords.

Keyword-driven testing divides test cases into Test Steps.
Each test step usually consists of three different parts: 1) the Test Object, 2) the Action (represented by the ‘keyword’) on the test object and 3) the Data for test action

Keyword-driven testing separates test automation into two distinct activities: 1) Test Design and 2) Test Implementation.
There are two phases required to create keyword-driven tests:
1) Designing the test
2) Implementing the keywords
Test design is performed by testers and non-programming staff who write tests using keywords, whose expertise is on the domain knowledge and business logic side.
Even though the correct syntax for the keywords need to be followed while writing a test, tools like Maveryx enable this to be relatively easy to do, for example by providing a drop-down list of valid keywords and checking the syntax of the parameters entered to the keywords. In this way, they are not involved in the implementation of the keywords, and just need to focus on designing the right test cases using keywords.

In parallel to test design, the keywords are implemented (i.e. coded) by test automators, using the scripting language of the testing tool they are using.

What are the benefits of keyword-driven testing?
Keyword-driven testing clearly separates the programming work of test automation from test case design. Test Design and Test Implementation can be worked on in parallel. This allows tests to be developed earlier in the software development lifecycle, even before a stable build is delivered for testing.

Another benefit is that as keywords are written in simple natural language. Tests are concise, very easy to read and to understand also by a non-technical audience. This also makes them easier to modify and to maintain.

The non-technical character of the test cases also allows non-technical testers, for example business analysts, to get involved in testing, producing more tests. This helps in boosting the team’s productivity and grants to achieve a greater test coverage in a shorter amount of time.

Last but not least, keywords for their nature provide a high degree of reusability. They can be reused across multiple test cases and test projects ensuring an unbeatable ROI for the organization.

How can I create keyword-driven tests with Maveryx?

With Maveryx, testers can use the good old Excel spreadsheet to write tests using keywords. Test scripts are written in the form of tables which shows every keyword name with its input arguments and test object. Through this approach, the test designer doesn’t have to know how to program or need any particular knowledge of the Maveryx’s tool.

The Maveryx Excel template is created in such a way that:
– Each sheet corresponds to a Test Case
– Each row corresponds to a Test Step of the Test Case
– Each column contains the parameters that are necessary for each test action

Let’s create a simple design of a keyword driven test with the help of a common user scenario as the login to a web application.

1. Start Browser and Navigate to URL
2. Enter username
3. Enter password
4. Click on the Login button
5. Check the successful login

When performing an operation on a GUI item, the following parameters should be at least specified: Name of GUI item, what operation to perform (the keyword) and its values.
For example, set value “maveryx” in Username control, set value “maveryx” in Password control field.

The script will result in:

Differently from all other test tools, with Maveryx you don’t need(!) to capture an Object Repository for storing the properties of the objects available in Application-Under-Test.
The designed test script is immediately executable.

To execute the Excel spreadsheet user can create a simple Driver Script. This is the main script that reads all the contents of the excel sheet and performs the corresponding action.

Alternatively, it is possible to run the XLS/XLSX file via java command line.

For example:
KeywordDrivenTestingCLI –o “C:\Report” “C:\Test\test001.xlsx”
The test script C:\Test\test001.xls is executed and the test report is stored in C:\Report

Basically, Maveryx provides a comprehensive set of Keywords which is used to create test cases, but users can add their own ones too.

Conclusion
Keyword-driven testing is a software testing methodology that separates test design from test development.
The idea in Keyword-Driven Testing is to provide a set of “building blocks”, referred to as Keywords, which can be used to create automated test cases without requiring any knowledge of programming or test tool expertise. In keyword-driven testing, each keyword corresponds to an individual testing action like a mouse click, selection of a menu item, keystrokes, or other actions.
Maveryx supports keyword-driven-testing providing a huge number of keywords that let testers perform almost any test action in their UI keyword-driven tests.
With Maveryx, users can build automated tests for desktop or web applications in a tabular format using Excel and run them immediately as the application is available for testing. This, regardless of the users’ skills level.
Keywords are not magic, but they can help organizations to do more automated testing earlier in the testing process and to make it easier to maintain tests over time.

External links
https://en.wikipedia.org/wiki/Keyword-driven_testing
https://www.iso.org/standard/62821.html
https://www.slideshare.net/MaveryxTesting/keyword-driven-testing-48935887