--- title: Automated Test Framework use case: test a Service Catalog request description: This use case illustrates testing a service catalog request with the Automated Test Framework. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/application-development/automated-test-framework-atf/atf-serv-cat-use.html release: australia product: Automated Test Framework \(ATF\) classification: automated-test-framework-atf topic_type: task last_updated: "2026-03-12" reading_time_minutes: 5 breadcrumb: [Automated Test Framework use case examples, Automated Test Framework \(ATF\) reference, Automated Test Framework \(ATF\), Testing and debugging applications, Building applications] --- # Automated Test Framework use case: test a Service Catalog request This use case illustrates testing a service catalog request with the Automated Test Framework. ## Before you begin Role required: atf\_test\_admin ## About this task With the Replay Request Item test step, you can test the service catalog ordering process once a request exists and has a record in the request item table. In the Australia release, you cannot create an automated test for the process by which the user creates a new request. \[Omitted image "atf-use-serv-cat.png"\] Alt text: Test steps ## Procedure 1. Replay an existing service catalog request item. This test step inserts a new record in the \[sc\_request\] table for the catalog request item RITM0010001. \[Omitted image "atf-use-sc-step-01.png"\] Alt text: Replay request item This insertion triggers the Service Catalog Request workflow, which checks the price of the item, determines that it exceeds $1000.00, and therefore generates approval records for users belonging to the Catalog Request Approvals group. In this example, only one user– Eric Schroeder – belongs to this group. \[Omitted image "atf-use-sc-scrwf-a.png"\] Alt text: Service catalog request workflow 2. Impersonate Eric Schroeder, the user who needs to approve this Service Catalog Request. \[Omitted image "atf-use-sc-step-02.png"\] Alt text: Impersonate test step 3. Verify that the system created an approval record for Eric Schroeder and this request. Note that for the **Approval for** field, you assign the output value from Step 1. \[Omitted image "atf-use-sc-step3.png"\] Alt text: Record query test step 4. Set the state of this approval record to Approved. \[Omitted image "atf-use-sc-step-04.png"\] Alt text: Update setting approval state The Service Catalog Request workflow sees that all required approval records have the state of Approved and transitions to the Approval Action which marks the request record \[sc\_request\] as Approved. \[Omitted image "atf-use-sc-scrwf-b.png"\] Alt text: Sc workflow with approval portion highlighted When the record in \[sc\_request\] changes to the Approved state, an associated business rule generates request items \[sc\_request\_item\] for each item in the request. In this example, the request contains only one item, so the business rule inserts one record into the \[sc\_request\_item\] table. This insertion triggers the Service Catalog Item Request workflow. \[Omitted image "atf-use-sc-item-wf.png"\] Alt text: Service catalog item request workflow The first activity in the Service Catalog Item Request workflow generates an approval record for the head of the department in which the requesting user works. In this example, the department head is Natasha Ingram. \[Omitted image "atf-use-sc-ir-01.png"\] Alt text: Service catalog item workflow 5. The workflow does not continue until the department head approves it, so the next test step impersonates Natasha Ingram. \[Omitted image "atf-use-sc-step-05.png"\] Alt text: Impersonate user test step 6. Obtain the sys\_id for the new approval record with the Record Query step. Note that Record Query creates an output variable with the sys\_id of the first record returned from the query. \[Omitted image "atf-use-sc-step-06.png"\] Alt text: Record query test step 7. Set the approval record to Approved. \[Omitted image "atf-use-sc-step-07.png"\] Alt text: Approval user test step Note how Step 7 refers to the **First record**output variable from Step 6 to specify which record to approve. When the record is approved, the workflow transitions to the next Approval - User activity, which generates an approval record for the CIO. In this example, the CIO is Bow Ruggeri. \[Omitted image "atf-use-sc-ir-02.png"\] Alt text: Service catalog item workflow 8. Impersonate Bow Ruggeri. 9. Obtain the sys\_id for the approval record for Bow Ruggeri. 10. Set the approval record to Approved. When the record is approved, the workflow transitions to the Approval Action activity which sets the record for this item in the \[sc\_request\_item\] table to **Approved**. The workflow transitions to the Catalog Task activity labelled Asset Mgmt. Fulfills Order. This Catalog Task activity generates a new record in the \[sc\_task\] table that instructs a user in the Fulfillment group to order the item. \[Omitted image "atf-use-sc-ir-03.png"\] Alt text: Service catalog item workflow 11. Impersonate a user in the Fulfillment group, in this example ATF.User. \[Omitted image "atf-use-sc-step-11.png"\] Alt text: Impersonate user test step 12. Obtain the sys\_id for the new catalog task with the Record Query step. Note that Record Query creates an output variable with the sys\_id of the first record returned from the query. \[Omitted image "atf-use-serv-cat-step12.png"\] Alt text: Record query test step 13. Mark the \[sc\_task\] record as **Closed Complete**. \[Omitted image "atf-use-sc-step-13.png"\] Alt text: Record update test step Note how Step 13 uses the **First record**output variable from Step 12 to specify which record to mark as **Closed Complete**. When the record is marked **Closed Complete**, the workflow exits the Catalog Task activity along the In Stock exit path. \[Omitted image "atf-use-sc-ir-04.png"\] Alt text: Service catalog item request workflow The workflow transitions to the Notification activity, then to the Catalog Task activity labelled Deploy Item to User.The Deploy Item to User Catalog Task activity inserts a new record into the \[sc\_task\] table that instructs a user in the Deployment group to deliver the item. 14. Obtain the sys\_id for the new catalog task with the Record Query step. Note that Record Query returns an output variable with the sys\_id of the first record returned from the query. \[Omitted image "atf-use-sc-step-14.png"\] Alt text: Record query test step 15. Mark the \[sc\_task\] record as Closed Complete. Note how Step 15 uses the **First record**output variable from Step 14 to specify which record to mark as Closed Complete. \[Omitted image "atf-use-sc-step-15.png"\] Alt text: Record update test step When the record is marked Closed Complete, the workflow exits the Catalog Task activity, logs a message, and exits. \[Omitted image "atf-use-sc-ir-05.png"\] Alt text: Service catalog item request workflow 16. Verify that the request item in \[sc\_request\_item\] has the state Closed Complete. \[Omitted image "atf-use-sc-step-15.png"\] Alt text: Record validation dialog 17. Verify that the request \[sc\_request\] has the state Closed Complete. \[Omitted image "atf-use-sc-step-16.png"\] Alt text: Record validation test step **Parent Topic:**[Automated Test Framework use case examples](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/atf-use-cases.md) **Related topics** [Replay Request Item](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/automated-test-framework-atf/test-steps-server-category.md)