Notifications

19 views

Description

Your automated test framework Record Query step needs to find the second approver for a request item.  What series of steps will enable you to find the second approver and approve the request item?

Cause

There is no out-of-box ATF test that explains how to search for the second approver, impersonate that approver, open the approval form, and approve the RITM.

The general steps are not difficult, but you need an example of each step:

  1. Get RITM record using Req ID associated with the RITM 
  2. Validate the record to ensure that RITM exist and the stage is approval
  3.  Get the sysapprover_approval record using RITM ID from step A
  4. Impersonate the approver
  5. Open the approval form using Approval ID from step C

Resolution

This example will be built on the first 6 steps of the out-of-box test named Search and Open Catalog Item.

This KB adds or update 7 more steps to ensure that each approver that you want to use is opening his own approval record and updating the state to approved.

The ATF images below show the progression of test steps.

 The original out-of-box 'Search and Open Catalog Item' looked like this for the catalog item 'Apple iPhone 5'.

 

For that catalog item above 'Apple iPhone 5', please note that before proceeding, if you want to actually execute this specific test, you would need to add a second approver to the workflow stage for the catalog item, so that the steps below will succeed when you search for the second approver.  This KB does not cover the addition of a second approver to the workflow stage.   

Your own catalog item has that second approved, and it's more expedient to modify your own test by adding the steps below to your test, rather than to create and debug this example of an ATF test for a two-approval catalog item.

Here are the steps to add to your test, or to the out-of-box 'Search and Open Catalog Item' test:

__________


Step 7 Record Query - to get RITM record using Req ID from step 6

__________


Step 8 Record Validation - to ensure that RITM exist and the stage is approval

__________

Step 9 Record Query - To get sysapprover_approval record using RITM ID from step 7

__________


10 Impersonate - impersonate (second) approver to validate

 

__________


11 Open the existing form - To open approval form using Approval ID from step 9

__________


12 Set Field Values - You can set the state to Approved

__________


13 UI action button - Click Update button to save the form

__________


After 13, remove steps 14 to 19 from out-of-box test named 'Search and Open Catalog Item'.  Just put a checkbox next to each step to delete and click the Delete option in the dropdown at the bottom of the list. 

 

__________

The final test looks like this.  Your test would appear similar.

 

__________

The test steps above explain how to search for the second approver, impersonate that approver, open the approval form, and approve the RITM.

Article Information

Last Updated:2019-12-03 13:37:28
Published:2019-12-03