Test Combinations Generator
With UFT 14.0, HPE has added a new feature in UFT Feature stack – Test Combination Generator (let’s call it TCG). Test Combinations Generator provides you the capability to create multiple test data combination for your application to test. This feature provides real benefits for Business Process Tests, however you can also use in GUI tests.
While working with Test Combination Generator in one of my project, I found a minor bug, refer Found a flaw – UFT 14
When Should I use Test Combinations Generator?
TCG should be used in a scenario where you have multiple parameters with multiple values for a test. In such case, TCG would generate the maximum possible combination of values for the parameter. This is very helpful when you have test with multiple combination of data for a single test case. Here is an example to understand it better, refer the flight reservation sample application. One of the process flow would be –
Log in >> Find Flights >> Book a Flight >> Confirmation
Let’s see different data combinations on Find Flights page
|2 x 4 x 10 x 10 x 3 x 4 = 9600|
More than 9000 combinations of data required to test this flow. Note that, we have not considered the dates yet, it will be more if you include those as well. Writing such combinations is, too time and effort consuming and not a wise idea at all. TCG feature is going to do the magic and make our life easy.
How Does Test Combinations Generator Work?
TCG Works on Optimization algorithms. With the preferred algorithm chosen, it generates the best suitable combination which would be sufficient to cover the process flow. There are three algorithm available to choose from –
Pairwise – algorithm is an effective combinatoric test generation technique that can generate relative small test suite to cover all pairs of parameter values at least once. As name suggests, it takes pairs at a time for comparison.
Linear – algorithm is to achieve the best outcome. It’s a technique for the optimization of a linear objective function, subject to linear equality and linear inequality constraints. Which means the outcome will be a set of combination which intersects across all different combinations.
Triplewise – is likely to be the same as pairwise with the difference as it takes triplets at a time for comparison.
To start using Test Combinations Generator, ensure that you have test parameters created.
Step 1 Open Test Combination Generator
Step 2 Provide possible values for Parameters
UFT displays test parameters in TCG main window, you should enter the possible values for these parameters. Here can specify the values as HAPPY PATH or ERROR PATH.
Happy Path – values are not expected to cause an exception or error in the application. I feel, in other way it’s actually Value for Positive Testing
Error Path – values are expected to cause and exception or error in the application, other way Value for Negative Testing
There are other options you will find at the right of window
Generate Parameters – Helps you to populate random data for specified types like Full Name, Email, URL, Passwords etc.
Import and Export options lets you import or export values for your Parameters.
Step 3 View Combinations
Click on View combinations, UFT display possible combinations based on the possible values supplied for test parameters.
By default, Pairwise algorithm is selected. You can switch to other algorithms Liner or Triplewise. All three will display different set of combinations.
Interesting fact to know here is even though if the number of combinations is huge, UFT can only generate and display maximum 1000 combinations.
Step 4 Generate Configurations
Now that you have entered the parameters and selected the algorithm to use, you can generate the different combinations.
First, instruct UFT which configurations to generate. If you click Filter, you can choose from Regular Path (the standard combinations), Happy Path, or Error Path combinations.
Then, in the bottom part of the Test Combinations Generator, click Generate. UFT pauses for a bit, generates the combinations and adds them as a new test configuration in the Properties pane.
This test configuration can now be used in any test run.
That was all for TCG in this post, Let us know how does it work for you. We will continue to explore more and update on new and advanced features of UFT, Stay tuned.
[…] The Test Combinations Generator helps you prepare test configurations by using the parameters in your test and their possible values to create multiple possible data combinations. UFT can then generate them into a test configuration that you can use when running a business process test. Learn more about Test Combinations Generator […]