Case Study
Creating an Automated Test Framework for Case Creation
Problem Statement:
The client needs to create an automated test framework (ATF) for case creation. Specifically, they want to ensure that an inbound email action with specific values should create a case, the ATF will reprocess a "received" email and will verify that the correct inbound action executed and then the ATF will verify if the case is created correctly.
Solution:
To create this ATF, the following steps were added:
Step 1:
Navigate to sys_email table The first step was to navigate to the sys_email table in the ServiceNow instance. This is where all emails received by the system are stored.
Step 2:
Apply a filter "sys_id=" Next, a filter was applied to the sys_email table to retrieve the record of the received email that needs to be reprocessed.
Step 3:
Open the record found in the sys_email table The record of the received email was opened to execute the "Reprocess Email" UI action.
Step 4:
Execute the "Reprocess Email" UI action The "Reprocess Email" UI action was executed to reprocess the received email.
Step 5:
Navigate to "syslog_email" table After the email was reprocessed, the next step was to navigate to the syslog_email table in the ServiceNow instance. This table contains the logs of all email activities in the system.
Step 6:
Apply a filter "message contains Processed Create New Case" A filter was applied to the syslog_email table to retrieve the log entry for the email that was reprocessed.
Step 7:
Verify that the "Create new Case" inbound action executed The log entry for the email was checked to verify that the "Create new Case" inbound action was executed.
Step 8:
Navigate to sn_customerservice_case table Next, the sn_customerservice_case table was accessed to verify if the case was created.
Step 9:
Apply a Filter: "short description Contains Created by email and created in last 15 minutes" A filter was applied to the sn_customerservice_case table to retrieve the case that was created as a result of the inbound email action.
Step 10:
Verify the case is created The case that was created was checked to ensure that it was created correctly.
Step 11:
Verify the values are set properly according to the inbound action The values of the case were checked to ensure that they were set according to the values specified in the inbound email action.
Step 12:
End Test The test was ended after all the above steps were completed.
Conclusion:
By following the above steps, an automated test framework was created for case creation in ServiceNow. This will help the client to ensure that the inbound email action with specific values creates a case correctly every time it is executed, thereby reducing the risk of errors and improving the overall quality of the system.