Business Process Testing in UFT One - End-to-end scenario
Relevant for: business process tests and flows
This topic describes an end-to-end scenario of using Business Process Testing in UFT One to test the Flight GUI app, provided with the UFT One installation.
Just as in regular GUI testing with UFT One, you must prepare by covering the following prerequisites before creating your test:
Determine the technologies used in your applications
This is important as you must load the appropriate add-ins in UFT One to test your application's technologies. Depending on what technologies your application uses, UFT One loads the necessary tools that enable UFT One to communicate with and recognize objects in your application.
For the flight reservation application, the application is based on Windows Presentation Foundation (WPF) technologies, so you must load the WPF Add-in in UFT One.
Determine the functionality that you want to test
Consider how a user uses the application. Once you do this, you can determine how what resources you need and what components you need to create for the different part of your applications.
For the flight reservation application, you have a multiple areas of the application, with a number of user actions:
Login page: The user logs in to the flight reservation application
Flight search page: The user searches for available flights or booked flights.
Flight selection page: The user selects a flight from the available flights
Flight confirmation and booking page: The user confirms the selected flight and enters the customer details.
Decide how to divide the testable functionality into smaller units
By dividing the test into smaller chunks, you can make it more manageable and easier to follow.
Based on this list of application windows and tasks, you can create four different components for the different areas of the application.
To prepare UFT One for testing the app with ALM:
Load the WPF add-in in the Add-in Manager. This loads the necessary support for UFT One to work with WPF-based applications.
After UFT One starts, connect to ALM to enable yourself to use Business Process Testing with UFT One. Once you are successfully connected with ALM, UFT One displays an icon in the lower right corner of the main window.
For more details, see Work with tests and components in ALM.
Create or have a default application area. This application area contains the object repositories, custom function libraries, and application settings.
In the application area's additional settings, configure UFT One to work with the flight reservation application.
Create the business process test and record steps to test the MyFlight app.
To record a business process test:
Create a business process test. Select New > Test > Business Process Test, selecting a location on your ALM server.
Define the recording settings for your BPT test in the Options dialog.
Select Tools > Options > BPT Testing > Recording Settings, and then select the following options:
Automatically create snapshot for newly recorded components when recording a BPT test.
This enables UFT One to create a parameter for each object in your application. You can use these parameters after you record to parameterize your test.
Automatically check in newly recorded components when recording a BPT test
Create a new business process test.
Select File > New > Test > Business Process Test, and save your test on the ALM server.
Click Record .
At the prompt, select to create a Keyword GUI Component with the correct application area specified.
Tip: Remember that you want to divide your testing steps into multiple components.
UFT One will enable you to create new components as you record.
Click Add to start recording. UFT One goes to the background, and the Record toolbar appears.
Open the MyFlight GUI app to the login page, and log in to record those steps.
As you record, the recording toolbar shows the number of steps recorded.
In the recording toolbar, click the Add New Business Component button each time you want to create a new component, for each new page in the app.
Continue performing steps in the MyFlight app to create a flight reservation, creating new business components for the Flight Finder, Select Flight, and Flight Confirmation pages.
When you're done, click Stop to stop recording.
Back in UFT One, all of the recorded components are displayed in your test.
You do not need to save anything - the test and components are automatically saved in ALM.
- Continue with Enhance your test.
Modify your test using any of the following enhancement options:
Select components and group them together to enable certain functionalities, such as common parameterization or run conditions, for all components in the group.
Select the components, right-click and select Group.
Change parameter values across iterations
If you've defined your UFT One options to parameterize your steps (see Tools > Options > BPT Testing) click a component in your test to view the recorded parameters in the Properties pane.
In the Data pane, add new rows for additional iterations with new values. For example:
Set run conditions
Define UFT One's actions in case the component fails in a specific test run.
Select the component, and select the On failure value in the Properties pane to change it to Exit (stop the test) or Continue (test continues running).
If you have a more complex application that is likely to have dynamic run-time values, or does not have a linear user flow, add branches to determine how UFT One runs your components.
For more details, see Use BPT branches.
Create a test configuration to modify the parameter values across test runs
Enable UFT One to vary the data your test uses when running by using a test configuration. When UFT One runs the test, the data in the test configuration is used as parameter details, instead of the set values provided in the individual components.
For more details, see Generate data to drive your test.
Click Run to run your test. UFT One performs each step in the application, as configured.
For more details, see Run tests and components.