The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Getting error "Uncaught ReferenceError: current is not defined" while running ATF test case

kushal_dangare
Tera Expert

I am getting error "Uncaught ReferenceError: current is not defined" while running ATF test case.

What modification do I need to do in below UI action code to avoid this?

find_real_file.png

1 ACCEPTED SOLUTION

Mark Stanger
Giga Sage

That error is coming from a UI action on the form and doesn't have anything to do with ATF.  You'll see the same error when interacting with that form normally.  Your UI action is a client-side UI action but it is calling 'current' (which is undefined).  In order to resolve the issue you'll need to construct your UI action as shown in this SNGuru article.

https://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/

View solution in original post

1 REPLY 1

Mark Stanger
Giga Sage

That error is coming from a UI action on the form and doesn't have anything to do with ATF.  You'll see the same error when interacting with that form normally.  Your UI action is a client-side UI action but it is calling 'current' (which is undefined).  In order to resolve the issue you'll need to construct your UI action as shown in this SNGuru article.

https://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/