ATF Madrid - Cannot Submit using Order a Catalog Item (SP)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2019 04:03 AM
I have set up the following test steps for an ATF test in Madrid, and you can already see the problem :).
We cannot seem to go past submitting a RITM using the ATF test step Order a Catalog Item (SP). The Client Test Runner clicks "Order Now" (we are not using a cart layout), it reads "Submitting..." but then it fails with no more detail than "FAILURE: Validations failed. Failed to Order Item."
Validation failing cannot be true since all mandatory fields are filled in by steps prior to Order a Catalog Item (SP), as you can see. I have also tried testing another, simpler catalog item with the same result. I have tried different browsers, impersonating my admin user instead of one with the role snc_internal, but all end up in the same error.
When creating the test using backend steps (so without "SP" behind the name of the step), the RITM gets submitted successfully, so this seems to only be a problem with the test steps that target the Service Portal.
We have quite a lot of customizations in our portal and I wouldn't be surprised if it is due to this issue with "submit" not found:
We are getting this warning on inspecting a catalog item that is yet to be submitted, probably as intended by ServiceNow. We have no trouble submitting the same catalog item from the portal manually, despite the submit UI action not found warning. At the same time, in Chrome > Inspect > Console the above warning for the UI action is followed tightly by the ATF error when tested from ATF:
Or is this because our Order Now is not OotB and as such, not supported? Ref.:
Any insight is greatly appreciated, including if there is an alternative way of submitting and getting a record from it. I have also tried Submit a form (SP) but I cannot extract the submitted record from it...
- Labels:
-
Automated Test Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2019 06:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 12:16 AM
You are right. I now have 2 customized widgets in my developer instance. The out of the box version is indeed able to submit yet still throw the UI Action warning, so the warning is probably nothing to worry about. I got the warning regardless of the widget.
However, depending on which widget I was using on the sc_cat_item page, my test failed at either Open a Catalog Item (SP) or at Order a Catalog Item (SP).
When it was the Open a Catalog Item (SP) that had failed, I got the error "FAILURE: Failed to open Catalog Item. Either you don't have access to the Catalog Item or g_form is not defined".
With Order a Catalog Item (SP) I got the original error "FAILURE: Validations failed. Failed to Order Item."
I am more interested in the latter, meaning understanding the kind of customization that is done to that particular widget. Unfortunately it was one I have only imported so I am not 100% sure what exactly was different compared to the OotB widget. It is not impossible to find out, but not easy either. Then the question is if it is a customization that one can live without :/.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 12:27 AM
Hi Sandeep,
As per the screenshot provided, the submit button is not visible for the form.
So, I would like to suggest either you remove that particular step of submitting the form, if possible .
Else, if that step is mandatory I would like to suggest you to use Server Side Script where you just copy the code of the SUBMIT button.
I faced a similar issue.
I hope this helps.
Please mark the answer as correct if it suffice your query.
Thanks.
Soumita.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2019 01:33 AM
Run Server Side Script has looked suspicious to me as well, as an alternative. Is there a chance you could share an example of your code that is required for the Order Now/Submit button to work from such a step? I would like to understand what bits I need to look for in my own widget. Thank you in advance!