Creating an ATF for service catalog item

Kathi
Tera Expert

I have created an ATF test for one of my service catalog items.  This particular catalog item has a Multi-Row variable set.

It is failing on the "Add row to multi-row variable set (sp)" and I can't figure out why it is failing.

My steps are as follows:

Open a Catalog Item (sp)

Set Variable Values (sp)  - a value in this step triggers the need for the multi-row variable set. 

Add row to multi-row variable set (sp) --  this is the step that is failing

Set Variable Values (sp)

Save current row of multi-row variable set (sp)

Order a Catalog Item (sp) 

 

I'm not sure what I'm missing or what is causing this step to fail.  There is no comment in the test to give me a clue why that step is failing.  Any assistance would be appreciated.

 

Thank you.

1 ACCEPTED SOLUTION

mkdangi21
Giga Expert
  1. Check for custom Javascript: Examine any custom JavaScript that you have implemented in the catalog item's client script or UI policies, which might interfere with the ATF test. Disable the custom scripts temporarily to see if the test starts working.

  2. Verify variable configuration: Ensure that the multi-row variable set and its variables are configured correctly. Double-check the variable names, types, and other settings. Make sure that any mandatory fields in the multi-row variable set have values assigned during the test.

  3. Inspect the browser console: When running the ATF test, open the browser's developer console (F12 in most browsers) and look for any errors or warnings related to the multi-row variable set step. These messages might give you a clue about the issue.

  4. Test manually: Try to replicate the steps of the ATF test manually in the Service Portal to ensure the catalog item and its variables are functioning as expected. If you encounter issues during manual testing, it might indicate a problem with the catalog item itself.

  5. Add more log messages: In the ATF test steps, add log messages to output the values of the variables and other relevant information during the test execution. This might help you identify any discrepancies in the data or unexpected behaviors.

  6. Review the test execution details: After running the ATF test, click on the failed test step in the Execution Details tab to see if there are any additional details or error messages. Sometimes, these messages provide more information about the cause of the failure.

  7. Break down the steps: If you're still unable to identify the issue, try breaking down the failing step into smaller steps or isolate the issue by creating a separate test with fewer steps focused only on the multi-row variable set.

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Kathi 

Did you try to give some timeout for the failing step i.e. 5 or 10 seconds?

what's the failure message it shows?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

mkdangi21
Giga Expert
  1. Check for custom Javascript: Examine any custom JavaScript that you have implemented in the catalog item's client script or UI policies, which might interfere with the ATF test. Disable the custom scripts temporarily to see if the test starts working.

  2. Verify variable configuration: Ensure that the multi-row variable set and its variables are configured correctly. Double-check the variable names, types, and other settings. Make sure that any mandatory fields in the multi-row variable set have values assigned during the test.

  3. Inspect the browser console: When running the ATF test, open the browser's developer console (F12 in most browsers) and look for any errors or warnings related to the multi-row variable set step. These messages might give you a clue about the issue.

  4. Test manually: Try to replicate the steps of the ATF test manually in the Service Portal to ensure the catalog item and its variables are functioning as expected. If you encounter issues during manual testing, it might indicate a problem with the catalog item itself.

  5. Add more log messages: In the ATF test steps, add log messages to output the values of the variables and other relevant information during the test execution. This might help you identify any discrepancies in the data or unexpected behaviors.

  6. Review the test execution details: After running the ATF test, click on the failed test step in the Execution Details tab to see if there are any additional details or error messages. Sometimes, these messages provide more information about the cause of the failure.

  7. Break down the steps: If you're still unable to identify the issue, try breaking down the failing step into smaller steps or isolate the issue by creating a separate test with fewer steps focused only on the multi-row variable set.

Kathi
Tera Expert

I went through each of the steps you suggested.  The last one, breaking down the steps, was the one that resolved the issue.  I also rearranged the order a bit too.  I opened the form, set the variable that would trigger the multi-row, then did the add multi-row step, set the variables in the multi-row, saved the multi-row, then set the variables for the remaining mandatory variables on the catalog item.  That worked.   Than you for the assist.

glad it helps.