Skip to content

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: 
  1. What all actions should be recorded here 
  2. Where do we need to add validations like Assert and Verify. 
Go to 'My Favorites' and review the pre-loaded Test Script 'Verifies the Actual Results with the Expected Results' in your Sandbox.

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
  1. Go to Test Scripts and click 'Create'. Select the Product Name 'Health Insurance Calculator'. Click 'Use Native QaSCRIBE'
  2. Enter the Test Script Name ' Automate Verify Results of the HICC - State = NJ Zip = 08817 Age = 45 Income = $20000''
  3. Click the Pen icon to enter the Description: 'This Script will Verify output in AUT - Health Insurance Cost Calculator'
  4. Go to the HICC - Production Web page and ensure you're on the Results page.
  5. Click on the record button to capture the instruction using Qascribe, Select the Existing page of the Health Insurance Cost Calculator result screen.
  6. Click on the Checkbox - Don't record instructions with 'Open' and related commands and click on Next
  7. Right Click on the Result Header " You are eligible for a subsidy" on the screen and click on Show Context Menu and Select Asserttext
  8. Right-click on the premium value, Select Context Menu and choose verifytext.
  9. Right-click on the penalty value, Select Context Menu and choose verifytext.
  10. Switch to Worksoft SaaS and stop the recording.
  11. Add Comment above Instruction 1 by clicking on 3rd Icon in Actions as 'Verify the Result Message Header of the Page'.
  12. Add Comment below the first instruction as " Verify the Estimated Annual Premium Cost"
  13. Add Comment above 3rd instruction as "Verify the Annual Penalty If Uninsured".
  14. Click on Save and Continue the Test Scripts
To check whether the instructions are working accurately, click on the 'Play' button and execute them locally. 

Execute (play) this test script stand-alone
  1. Ensure you're on the Results page of the AUT.
  2. Ensure you're on the Test Script - Automate Verify Results of the HICC - State = NJ Zip = 08817 Age = 45 Income = $20000
  3. Click on the play button (Execute (play) this test script stand-alone)
  4. From the Execution wizard, Select the Environment as Production and click on Next.
  5. Select the Existing AUT Tab from the dropdown and click on Next. (This will trigger the local execution on Existing Tab)
  6. 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.





Feedback and Knowledge Base