Create a keyword-driven GUI test

Relevant for: GUI tests only

This task describes how to create a test using the keyword-driven methodology.

After creating your test, run it to test your application and analyze the results, debug the test, or run in Maintenance Mode or Update Run Mode to maintain changes.

For details, see Run / Debug tests and Maintain tests or components .

Analyze your application

Before you begin creating a test, analyze your application and determine your testing needs.

You need to determine:

The development environments

Determine the development environments in which your application controls were developed, such as Web, Java, or .NET, so that you can load the required UFT One add-ins.

The functionality to test

Determine the functionality that you want to test.

To do this, consider the various activities that customers perform in your application to accomplish specific tasks.

  • Which objects and operations are relevant for the set of business processes that need to be tested?

  • Which operations require customized keywords to provide additional functionality?

How to organize your test

Decide how to divide these processes into smaller units that will be represented by your test's actions.

Each action should emulate an activity that a customer might perform when using your application.

Tip: As you plan, try to keep the amount of steps you plan to include in each action to a minimum.

Creating small, modular actions helps make your tests easier to read, follow, and maintain.

Back to top

Prepare the testing infrastructure

Prepare the infrastructure needed for your test.

Build the set of resources for your test

This includes:

Shared object repositories

Contain test objects, which are representations of the objects in your application.

For details, see Test objects in object repositories.

Function libraries

Contain functions that enhance UFT One functionality.

For details, see User-Defined Functions.

Recovery scenarios

Instruct UFT One to recover from unexpected events and errors that occur in your testing environment during a run session.

For details, see Recovery scenarios.

Additional optional files

Includes data table files and environment variable files.

For details, see Parameterize object values.

Configure UFT One according to your testing needs

This can include setting up global testing and test-specific preferences, as well as run session preferences.

Associate any recovery scenarios with your test, and create automation scripts to set required configurations at the start of a run session.

For details, see:

Create one or more tests that serve as action repositories

This enables you to store the actions to be used in your test and maintain your actions in one central location.

For details, see Actions in GUI Testing.

Associate your resources with your test and the relevant actions

Associate your function libraries and recovery scenarios with the relevant tests so that you can insert steps using keywords.

Also, associate object repositories with relevant actions so you can insert steps using the stored test objects.

For details, see:

Back to top

Add steps to the actions in your test action repository

Create steps using keyword-driven functionality. You can use the table-like, graphical Keyword View—or you can use the Editor if you prefer to program steps directly in VBScript.

You can add steps to your test in one of the following ways:

Drag objects from your object repository or from the Toolbox pane

This adds keyword-driven steps in the Keyword View or the Editor.

The object repository and Toolbox pane contain all of the objects that you want to test in your application.

Record on your application

As you navigate through your application during a recording session, each step you perform is graphically displayed as a row in the Keyword View.

For details, see Keyword View.

Drag objects from the Object Spy

After highlighting an object in the Object Spy, drag it directly into the test. A step is added with the appropriate object hierarchy.

This option is available only for the Editor.

Back to top

Enhance your test

Enhance the testing process by modifying your test with special testing options and/or with programming statements.

For details, see:

Back to top