Building automation of the second Test Script
This article is a part of the Self-paced Learning Series for the Course: First-Hand Experience of Worksoft SaaS.Please refer to the link for more details on the Course.
Mapping the Worksoft SaaS feature to the Course Context :: Lesson 11:: Topic 2
1. Test Script 3 of Test Case 1
Let's review the Test Script one more time to see:
- What all actions should be recorded here
- Where do we need to add validations like Assert and Verify.
In the pre-loaded Test Script, assert command was added after the Results page loads because if the page load fails for any reason, we want the Test to be aborted.
Also, as per the test case, we need to verify if the Premium and Penalty values are calculated as expected, hence we will add verify command.
2. Building automation of the second Test Script
We will follow the same approach as the pre-loaded Test Script, wherein, we will add 'assert' command after the Results page loads and add 'verify' command to verify the Premium and Penalty values.
Before recording this Test Script, it's important to ensure that we have the Results page of the AUT open, as a continuation to the previous Test Script.
3. Practice
Recording & adding comments to the second Test Script
- Go to Test Scripts and click 'Create'. Select the Product Name 'Health Insurance Calculator'. Click 'Use Native QaSCRIBE'
- Enter the Test Script Name ' Automate Verify Results of the HICC - State = NJ Zip = 08817 Age = 45 Income = $20000''
- Click the Pen icon to enter the Description: 'This Script will Verify output in AUT - Health Insurance Cost Calculator'
- Go to the HICC - Production Web page and ensure you're on the Results page.
- Click on the record button to capture the instruction using Qascribe, Select the Existing page of the Health Insurance Cost Calculator result screen.
- Click on the Checkbox - Don't record instructions with 'Open' and related commands and click on Next
- Right Click on the Result Header " You are eligible for a subsidy" on the screen and click on Show Context Menu and Select Asserttext
- Right-click on the premium value, Select Context Menu and choose verifytext.
- Right-click on the penalty value, Select Context Menu and choose verifytext.
- Switch to Worksoft SaaS and stop the recording.
- Add Comment above Instruction 1 by clicking on 3rd Icon in Actions as 'Verify the Result Message Header of the Page'.
- Add Comment below the first instruction as " Verify the Estimated Annual Premium Cost"
- Add Comment above 3rd instruction as "Verify the Annual Penalty If Uninsured".
- Click on Save and Continue the Test Scripts
Execute (play) this test script stand-alone
Please Note:
- Ensure you're on the Results page of the AUT.
- Ensure you're on the Test Script - Automate Verify Results of the HICC - State = NJ Zip = 08817 Age = 45 Income = $20000
- Click on the play button (Execute (play) this test script stand-alone)
- From the Execution wizard, Select the Environment as Production and click on Next.
- Select the Existing AUT Tab from the dropdown and click on Next. (This will trigger the local execution on Existing Tab)
- Is your execution successful? Review the Execution log.
Please Note:
You can drag and drop to rearrange the instructions if you observe they are not in a logical sequence
To drag just click and hold it down, move your cursor to correct the order of command.