What is the objective?
When you are writing a test case as a series of steps, it is often necessary to pass information from one step to other subsequent steps. For example, consider a Scenario to create a Purchase Order and verify it. Possibly, a PO number is created as part of one of the steps, which is required as input for the Verification logic. In this case, it is necessary to transfer information between the two steps, so that verification is happening on the relevant PO.
Consider another end-to-end automation example. As part of your test flow, you receive a verification code on your email which you are required to enter in your business application to log on to. How do you think you can achieve this information sharing in the automation flow?
Parameter Linking enables the transfer of data between multiple steps in a Scenario. This is not only helpful in connecting the output from one of the steps to another step as input, but also in situations where the same information should be passed to multiple steps in a Scenario.
For this challenge, we will apply this concept to extend the "Perform Funds Transfer" Scenario to validate that the Transaction ID displayed on the Account Summary Page matches the one generated during the funds' transfer operation.
In this Scenario, we will:
- Transfer funds, that navigates the application to the Confirmation page.
- Validate that the Transaction ID in the Recent Activity section (in Account Summary Page) matches the ID displayed in the Confirmation Page
- Log out of the QBank application
Here is the Scenario described in this video:
<video>
Automation Steps
Contexts/Pages
No additional contexts are needed for this challenge, as no new pages are being introduced in our flow.
Actions
We will need one additional Action for this Scenario. Click the “+” icon in the top right corner of the ACCELQ screen. Let's also write the logic for this Action.
Verify Transaction in Recent Activity: To verify if the funds' transfer was successful, this Action compares the transaction ID displayed in the confirmation page to be the same as the one displayed on the Account Summary page.
Create this Action in the Account Summary Page. Since this Action does not change the application state, you would choose "Current Context" as the destination Context.
Logic will simply involve verifying the text on the Transaction ID element in the Account Summary page with the expected transaction ID (input parameter).To make this verification possible, this Action requires one input parameter: Expected Transaction ID.
Scenario
In this challenge, we will be simply extending the existing Scenario “Perform Funds Transfer” to add the verification step. Open this Scenario.
Right-click on step-6 and select "Insert Step After". Point to the newly created Action Verify Transaction in Recent Activity.
Now, in the Scenario, "Expected Transaction ID" parameter value is the same as what was output as part of Step #5 ("Transaction ID"). Let's link these two parameters, as we cannot independently input the expected transaction ID.
Click on the “Expected Transaction ID” and select the third option of Parameter Linking. The dropdown lists all the parameters available from the earlier steps (Actions). Select the output parameter from Step #5.
The Scenario step will indicate that the parameters have been linked:
Run the Test
When you review the result, you will observe that the Transaction ID has been successfully transferred from Step #5 to Step #7, resulting in successful verification.
Comments
0 comments
Please sign in to leave a comment.