When creating a UFT test, there are a number of steps:
Analyze your application
The first step in planning your test is to analyze your application to determine your testing needs:
What are your application's development environments? To work with your application's user interface objects, you will need to load the appropriate UFT GUI Testing add-ins. For example, your application may be built in a Web, .NET, or Java environment. Therefore, you would need the Web, .NET, or Java Add-ins in UFT to work with these environments. What business processes and functionality do you want to test?
To do this, you think about the activities a user would perform in your application and the internal actions your application needs to perform to do these business processes.
You create GUI test steps to mimic the user's actions in the user interface. You create API test steps to perform the processes your application runs in the background.
Does your application use standard application activities or custom-designed services? Depending on what functions your application's API runs, you use the out-of-the-box activities provided with a UFT API test or import/create custom activities. How can you break your test into small testable units? You should break the processes and functionality you want to test into smaller tasks, so that you can create UFT actions in your GUI tests. These smaller and more modular actions make your tests easier to read and follow, and help ease maintenance in the long run.
Prepare the testing infrastructure
Based on your testing needs, you must determine what resources are required and create these resources accordingly.
- For a GUI test, these resources include shared object repositories, which contain test objects that represent objects in your application, function libraries, which contain custom functions to use in a test, recovery scenarios that instruct UFT how to respond when the application has problems, environmental variable files which contain definitions for common environment variables, or external data tables to use to parameterize test steps.
- For an API test, these resources include WSDL or WADL files describing the application service's methods, REST Services that you create to serve as a prototype or your application's REST process, external data sources, virtualization projects used with service calls, .NET assembilies referenced by a test step, or Java classes used in a test step. These resources must be imported or created in UFT.
You also need to configure UFT settings so that UFT will perform any additional tasks you may need, such as displaying a results report each time you run a test, enabling or disabling debugging for the test run, and the like.
Build your tests and adding steps to each test
After the testing infrastructure and resources are ready, you can begin building tests:
- For GUI tests, you can create one or more empty tests and add actions to them to create the testing skeletons. You then associate your object repositories with the relevant actions, so that you can insert the steps, either by the keyword-drive methodology or by creating scripts.
- For API tests, you can create one or more empty tests, add test steps to these tests by dragging activities to the test canvas, and define the input, output, and checkpoint properties for these steps. You can also group steps that run multiple times together in an action that can be run as an individual test step.
- You can also add all your tests to a single solution. A solution enables you to store, manage, and edit any related tests together, without having to close one test before opening another.
- You may also want to configure test preferences and settings (for GUI tests) or test-specific properties (for API tests).
Enhance your tests
You can enhance your tests in a number of ways:
For GUI tests...
- Insert checkpoints as test steps to check whether your application is functioning correctly. For example, these checkpoints can check for the specific value of a page, individual test object, or text string.
- You check how your application performs the same operations with different values by parameterizing test step values with mutiple sets of data. You do this by replacing the test step's fixed values with parameters.
- You can add programming and conditional or loop statements and other programming logic to your test using VBscript.
For API tests...
- You can validate test step and individual properties of test steps by selecting checkpoint properties and entering expected values for the step properties.
- You can check how your application performs the same processes with different values by parameterizing test step properties with multiple sets of data. You do this by replacing fixed values with parameters.
- You can add functionality to your test steps with custom code activities, event handlers, or custom activities created using UFT's Activity Wizard.
Debug, run, and analyze your test
You can debug your test using UFT's debugging functionality to ensure that it operates smoothly and without interruption. After the test is working correctly, you run it to check the behavior of your application. While running, UFT perfoms each step on the user interface of your application (while running a GUI test) or runs the application's API processes (while running an API test).
If you have access to an ALM server, you can report defects you discover to your ALM project. If not, you can manually report defects to your own defect database.